Skip to content

Instantly share code, notes, and snippets.

View tobihans's full-sized avatar
๐Ÿ™ƒ
Keep it Super Simple !

Hans Bignon K. Tognon tobihans

๐Ÿ™ƒ
Keep it Super Simple !
View GitHub Profile
@tobihans
tobihans / create_wildcard_cert_using_config.md
Created July 16, 2026 15:14 — forked from natgra/create_wildcard_cert_using_config.md
How to create wildcard certificates using config files

How to create a self-signed certificate request for a domain and all its subdomains with OpenSSL.

The configuration file

The certificate.conf can be used to create a configuration for a certificate. Its content can look as follows:

[req]
default_bits = 2048
default_md = sha256
prompt = no                                   # configuration for openssl command to not prompt, it will take req_distinguished_name instead
distinguished_name = req_distinguished_name   # the information required to generate a self-signed certificate
@tobihans
tobihans / csr.conf.md
Created July 10, 2026 23:47 — forked from yidas/csr.conf.md
Certificate(CSR) configuration file

Openssl commands:

openssl genrsa -out self-ssl.key
openssl req -new -key self-ssl.key -out self-ssl.csr -config csr.conf
openssl x509 -req -days 365 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt -extensions req_ext -extfile csr.conf

Sign from Root CA: openssl x509 -req -days 365 -extensions req_ext -extfile csr.conf -CA RootCA.crt -CAkey RootCA.key -in self-ssl.csr -out self-ssl.crt

@tobihans
tobihans / script.sh
Created January 27, 2026 15:29 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@tobihans
tobihans / camelCase-snake_case-types.ts
Created January 23, 2026 19:15 — forked from kuroski/camelCase-snake_case-types.ts
Typescript type camelCase / snake_case conversion
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}`
? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`
: Lowercase<S>
type KeysToCamelCase<T> = {
[K in keyof T as CamelCase<string & K>]: T[K]
}
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ?
@tobihans
tobihans / README.md
Created December 15, 2025 22:37 — forked from ingeniousgenius/README.md
JWT Auth + Refresh Tokens in Rails

JWT Auth + Refresh Tokens in Rails

This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.

I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)

Before trying it out DIY, I considered using:

@tobihans
tobihans / dump.lua
Created October 3, 2025 19:01
Dump neovim lsp configs in json
local servers = {
"elixirls",
"gopls",
"html",
"tinymist",
"vtsls",
"lua_ls",
"pyrefly",
"ruby_lsp",
}
@tobihans
tobihans / shadcn-multi-tag-input.md
Created July 27, 2025 21:43 — forked from enesien/shadcn-multi-tag-input.md
shadcn multiple tag input

shadcn/ui multi tag input component

A react tag input field component using shadcn, like one you see when adding keywords to a video on YouTube. Usable with Form or standalone.

Preview

image

Standalone Usage

@tobihans
tobihans / gist:0fc3ebf663586d296dde5313250f6f89
Created July 24, 2025 12:08 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@tobihans
tobihans / gist:edfffe33b783072d973e8d4f021b1671
Created June 6, 2025 18:59 — forked from mansam/gist:9332445
Audio device detection w/ pyaudio
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 006: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 001 Device 009: ID 1130:f211 Tenx Technology, Inc. TP6911 Audio Headset
# cat d.py
import pyaudio
# Collection of one line text art (โ—•โ€ฟโ—•โœฟ)
Collection of emojis and one line text art like (โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป ๐Ÿค—
ึผื‘ึผ_ื‘ึผ
ื˜ึผ_ื˜ึผ
ื›ึผโ€—ื›ึผ
ืœึผ_ืœึผ
ืžึผ_ืžึผ
ืกึผ_ืกึผ