Skip to content

Instantly share code, notes, and snippets.

View jcreager's full-sized avatar

Joe jcreager

View GitHub Profile
@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@twolfson
twolfson / README.md
Last active January 22, 2024 07:32
Setting up SOPS

I'm learning about SOPS and setting it up as my preferred mechanism for storing secrets. Here are my notes.

PGP

It’s security mechanism is that we (i.e. client) use a PUBLIC key from the receiver (i.e. server) and encode it with a random key (I’m saying nonce but it could be reused)

This varies from RSA and SSH because the server uses a PUBLIC key to identify the client.

Web of trust

Web of trust operates by still using PGP (i.e. encoding with recipient’s public key) but additionally, we can encrypt/sign the data as our own by signing it with the client’s private key.

This means the recipient will initially decrypt via our (i.e. client’s) public key (verifying the source) and then decrypting via their (i.e. server’s) private key to get the data.

@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@caniszczyk
caniszczyk / clone-all-twitter-github-repos.sh
Created October 9, 2012 04:25
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Cifro
Cifro / create-thumbnails.sh
Created February 12, 2012 14:31
Shell scripts for creating thumbnails from video files
# Author: Cifro Nix, http://about.me/Cifro
#
# usage:
# ./create-thumbnails.sh
# will produce thumbnails with name "<id>.jpg" with size 220x122
#
# different size:
# ./create-thumbnails.sh 640x360 -big
# will produce thumbnails with name "<id>-big.jpg" with size 640x360