Skip to content

Instantly share code, notes, and snippets.

View erhangundogan's full-sized avatar
👋

Erhan Gundogan erhangundogan

👋
View GitHub Profile
@erhangundogan
erhangundogan / StorageClass.yml
Last active May 20, 2023 08:23
kubernetes bare metal setup for Debian 10 (buster)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
allowVolumeExpansion: true
parameters:
storage: "lvm"
volgroup: "vg0"
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
@erhangundogan
erhangundogan / typescript-diagnostic.sh
Last active January 11, 2024 20:58
TypeScript compiler CLI commands to debug and diagnose your builds
# npm i -g typescript
# change directory to your project
# Prints out tsconfig.json including extended options if there is any.
tsc --showConfig
# You can use this flag to discover where TypeScript is spending it’s time when compiling
# https://github.com/microsoft/TypeScript/wiki/Performance
tsc --extendedDiagnostics
@erhangundogan
erhangundogan / currencies.js
Last active March 8, 2021 11:48
JS/JSON array of circulating currencies
// extracted from https://en.wikipedia.org/wiki/List_of_circulating_currencies
export default [
'AED',
'AFN',
'ALL',
'AMD',
'ANG',
'AOA',
'ARS',
'AUD',
@erhangundogan
erhangundogan / test.ml
Last active July 1, 2021 12:53
ocaml alcotest example
(*
utop # Alcotest.check Alcotest.string "foo" "abc" "abc";;
ASSERT foo
- : unit = ()
*)
(* A module with functions to test *)
module To_test = struct
let lowercase = String.lowercase_ascii
let list_concat = List.append
@Rich-Harris
Rich-Harris / README.md
Last active May 6, 2024 10:29
Testing array.splice vs array.pop vs set.delete

You have an array. Its sort order doesn't matter. You want to remove an item from this array.

The obvious thing to do would be to use splice:

function remove(array, item) {
  const index = array.indexOf(item);
  array.splice(index, 1);
}
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active July 20, 2024 14:39
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@sebmarkbage
sebmarkbage / The Rules.md
Last active June 30, 2024 01:30
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@tomysmile
tomysmile / mac-setup-redis.md
Last active July 16, 2024 04:45
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 22, 2024 13:05
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub