Skip to content

Instantly share code, notes, and snippets.

@PJUllrich
PJUllrich / big-o.md
Last active February 13, 2025 23:48
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@shu-yusa
shu-yusa / create_jwt.sh
Last active March 5, 2025 14:12
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",
@0x4D31
0x4D31 / beautiful_idiomatic_python.md
Last active November 22, 2024 08:34 — forked from JeffPaine/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@0xjac
0xjac / private_fork.md
Last active April 21, 2025 19:12
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@parmentf
parmentf / GitCommitEmoji.md
Last active April 21, 2025 21:17
Git Commit message Emoji
@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@xcommerce-gists
xcommerce-gists / CreateAccount
Last active December 25, 2015 12:21
How to Create a PayPal Account Using Adaptive Accounts.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: <Caller-UID>" # UserID from the Caller account
-H "X-PAYPAL-SECURITY-PASSWORD: <Caller-Pswd>" # Password from the Caller account
-H "X-PAYPAL-SECURITY-SIGNATURE: <Caller-Sig>" # Signature from the Caller account
-H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
-H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: <Caller-Sandbox-edress>"
-H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" # Standard Sandbox App ID