Open in app

Sign in

Write

Sign in

Febrilian
Febrilian

11 Followers

Home

About

Sep 13

Query based on Array of Strings in a JSONB field in PostgreSQL

Please don’t use ILIKE '%element_of_array%' when querying from JSONB field. Query based on the element of an array of strings in a JSONB field in PostgreSQL using the following steps: Create a table with a JSONB column. For example: CREATE TABLE products ( id serial PRIMARY KEY, name text, description jsonb ); Insert data into the table. For example: INSERT INTO products (name, colors) VALUES ('Product 1', '["red", "blue", "green"]'), ('Product 2', '["cyan", "magenta", "yellow"]');

1 min read

Query based on Array of Strings in a JSONB field in PostgreSQL
Query based on Array of Strings in a JSONB field in PostgreSQL

1 min read


Jun 28

The ‘Access-Control-Allow-Origin’ header contains multiple values ‘API_URL, *’, but only one is allowed.

Earlier today I got an error while configuring a new Linux server with NGINX and Go-based REST server. `Access to fetch at ‘https://{API_URL}/blog?limit=1' from origin ‘API_URL' has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘API_URL, *’, but only one is allowed. …

1 min read

The ‘Access-Control-Allow-Origin’ header contains multiple values ‘API_URL, *’, but only one is…
The ‘Access-Control-Allow-Origin’ header contains multiple values ‘API_URL, *’, but only one is…

1 min read


Oct 14, 2022

Deploy Golang App to Fly.io with Docker

Fly.io uses Docker to deploy your apps. When you use flyctl launch and flyctl deploy, it finds Dockerfile and docker-compose.yml files to containerize your project and set it live. So, before even touching any flyctl CLI commands, we need to configure Docker for our project first. Let’s look at this…

Docker

4 min read

Deploy Golang App to Fly.io with Docker
Deploy Golang App to Fly.io with Docker
Docker

4 min read


Oct 14, 2022

Benchmarking Fly.io vs Render vs Heroku

With the ending of Heroku free tier at November 28th 2022, devs are in search of a better PaaS alternative to host their apps. The things I need in a PaaS are: Low latency Ease of deployment Generous free tier Luckily, there’s a lot of available options, from Render, Fly.io…

Paas

3 min read

Benchmarking Fly.io vs Render vs Heroku
Benchmarking Fly.io vs Render vs Heroku
Paas

3 min read


Oct 11, 2022

Inserting Null to PostgreSQL in Golang

I have this use case where I want to insert timestamp value to the database, but the value can be null. If you insert an empty time.Time variable to PostgreSQL, the inserted value won’t be `NULL` but `0001–01–01 00:00:00`. Let’s see an example where my “orders” table looks like this: …

Go

2 min read

Inserting Null to PostgreSQL in Golang
Inserting Null to PostgreSQL in Golang
Go

2 min read


Aug 16, 2022

Stop Getting Paralyzed with CSS, use Tailwind

Few weeks ago, a lot of people are bashing Tailwind in a Telegram group discussion. The arguments against it are Tailwind slows down teams if not all of them able to use Tailwind, and it makes HTML/JSX ugly. Even one person tells an anecdote of a frontend dev that got…

Tailwind Css

3 min read

Stop Getting Paralyzed with CSS, use Tailwind
Stop Getting Paralyzed with CSS, use Tailwind
Tailwind Css

3 min read


May 2, 2022

How to Create Interactive Charts with Simple HTML

Few days ago, I was asked about how to make interactive graphs and charts, something like this page. I have made something like that but with React. The problem is it will only be used for a short presentation, so a full-blown react project would be an overkill, with consuming…

2 min read

How to Create Interactive Charts with Simple HTML
How to Create Interactive Charts with Simple HTML

2 min read


May 2, 2022

How to Brute-force with Go (Golang)

Few weeks ago, I did an assignment for a CTO position in an ed-tech startup. They asked me to find flaws in their system. I started from the simplest thing: authentication. I noticed that there was no login attempt limiter in their website. Then I checked the Network tab in…

Go

3 min read

How to Brute-force with Go (Golang)
How to Brute-force with Go (Golang)
Go

3 min read


Apr 8, 2021

Cara Mining Data di Twitter dengan Python dan Ekspor dalam CSV

Di internet, ada banyak data yang jika dikumpulkan dan diolah dengan baik akan menjadi alat yang bagus untuk pengambilan keputusan. Pada kali ini kita akan belajar untuk melakukan mining data dari Twitter menggunakan Twitter API dan Python, dan menyajikannya dalam format *.CSV supaya lebih mudah diolah kalau terbiasa menggunakan Excel.

Data Mining

3 min read

Cara Mining Data di Twitter dengan Python dan Ekspor dalam CSV
Cara Mining Data di Twitter dengan Python dan Ekspor dalam CSV
Data Mining

3 min read


Jan 22, 2021

Cara Data Mining dari Twitter dengan R Language

Tutorial step-by-step cara ekstrak data dari Twitter, pake Twitter API dan R Language. Daftar Twitter API Daftar dulu di sini supaya dapet aksesnya. Isi form doang, pasti akan dapet aksesnya setelah selesai isi pertanyaan-pertanyaannya. Tujuan akhir dari daftar Twitter API ini adalah mendapatkan (1) API Key (2) API Secret (3) Access Token, dan…

Programming

3 min read

Cara Data Mining dari Twitter dengan R Language
Cara Data Mining dari Twitter dengan R Language
Programming

3 min read

Febrilian

Febrilian

11 Followers

Software Engineering & Medicine

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams