Skip to content

Instantly share code, notes, and snippets.

View betawaffle's full-sized avatar

Andrew Hodges betawaffle

View GitHub Profile
@tekin
tekin / .gitattributes
Last active February 23, 2024 16:46
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
package jscan
import (
"bytes"
"errors"
"fmt"
)
var (
errIncomplete = errors.New("json: incomplete token")
package main
import (
"bytes"
"crypto/sha1"
"encoding/hex"
"errors"
"fmt"
"io"
"io/ioutil"
@harding
harding / craig-wright-2017-06-30.md
Created July 1, 2017 00:02
Craig Wright talk at Future of Bitcoin on 30 June 2017

[This is a transcript of Craig Wright's presentation at the Future of Bitcoin conference on 30 June 2017. This transcription should not be seen as an endorsement of Mr. Wright, a person who previously fraudulently claimed to be the creator of Bitcoin, among many other fraudulent claims.

Note that ellipses in the text ("...") represent the speaker trailing off or switching topics mid-sentence, rather than the omission of any text by the transcriber. All comments and additions from the transcriber appear between square brackets.

bip32 test vector 2:
seed : fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542
m : xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U
m/0 : xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt
m/0/42 : xprv9wSp6B7UBdybENFjzPMtDqKoddXxLZSijm538rhsNgSsnpD7VjcCc9XdzsBcWfS75TmeG27WLVsCEfaL7LzaEoNcKU8xUyzMqAS1DHHvTw6
m/0/42/2 : xprv9yidjfEMLNAmykgi1p3MVsP3huXJ17K55ywbpFSJYGUYJ5tTrz4aRJXMnUu4NJZVMTymi434adgFxfTwyr7YCQ3jQAaJiHNMd4uSR7bEXXE
---
@atoponce
atoponce / top500_results_table.md
Created December 16, 2016 17:13
A table showing top top 500 of 10-million most commonly passwords from Mark Burnett, and tested with different strength testers, with their scores and suggestions.

Top-500 Commonly Used Passwords

This table shows passwords which come from Mark Burnett's 10 million password dump, picking only the top 500. Each password is checked against our strength testers.

See the public Gist of atoponce/password_strength.md about a description of each generator and the strength tester.

| Password | Source | Pwqcheck | Cracklib-check | Pwscore | Zxcvbn |

@marianogappa
marianogappa / ordered_parallel.go
Last active February 12, 2024 09:27
Parallel processing with ordered output in Go
/*
Parallel processing with ordered output in Go
(you can use this pattern by importing https://github.com/MarianoGappa/parseq)
This example implementation is useful when the following 3 conditions are true:
1) the rate of input is higher than the rate of output on the system (i.e. it queues up)
2) the processing of input can be parallelised, and overall throughput increases by doing so
3) the order of output of the system needs to respect order of input
- if 1 is false, KISS!
@marianogappa
marianogappa / backpressure.go
Created December 4, 2016 04:53
Example backpressure implementation in Go
/*
This snippet is an example of backpressure implementation in Go.
It doesn't run in Go Playground, because it starts an HTTP Server.
The example starts an HTTP server and sends multiple requests to it. The server starts denying
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity.
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit
or https://godoc.org/golang.org/x/time/rate.
@bmhatfield
bmhatfield / .zshrc
Last active May 31, 2024 01:22
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active June 1, 2024 04:56 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from