Skip to content

Instantly share code, notes, and snippets.

View hossainemruz's full-sized avatar

Emruz Hossain hossainemruz

View GitHub Profile
package main
import (
"fmt"
)
type Number interface {
~int | ~int8 | ~int16 | ~int32 | ~int64
}
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active August 24, 2024 10:25
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@pyk
pyk / graceful_shutdown_while_loop.py
Created January 19, 2018 17:27
Graceful shutdown in Python While Loop
import time
import signal
def busy_work(seconds):
print("Start busy_work")
time.sleep(seconds)
print("Stop busy_work")
@ololobus
ololobus / create-and-fill-up-table.sql
Last active July 27, 2024 07:12
Create large ~1 GB random dataset in PostgreSQL
CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
EXPLAIN (analyse, buffers)
SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum
FROM large_test
GROUP BY num1;
@subfuzion
subfuzion / curl.md
Last active August 22, 2024 10:08
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@soarez
soarez / ca.md
Last active August 25, 2024 08:34
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.