Skip to content

Instantly share code, notes, and snippets.

@bierbaum
bierbaum / keybase.md
Created July 12, 2018 03:54
keybase.md

Keybase proof

I hereby claim:

  • I am bierbaum on github.
  • I am bierbaum (https://keybase.io/bierbaum) on keybase.
  • I have a public key ASDmgUVR9B66yhSQgLTGT-iUUb9RwOd_YTK_Q53DnEpiqgo

To claim this, I am signing this object:

@bierbaum
bierbaum / gofmt-git-pre-commit
Created February 26, 2016 12:52
A `gofmt` pre-commit hook that does what you want
#!/bin/sh
test -z "$GIT_HOOK_NO_GOFMT" || exit 0
function die {
echo "FATAL: $@" 1>&2
exit 128
}
files=""
#!/bin/sh
yes `yes`
#include <stdio.h>
#include <unistd.h>
int main(void) {
setbuf(stdout, NULL);
char *c = "\\-/|";
for (int i = 0; i < 4; i = (i == 3) ? 0 : i + 1) {
putc(c[i], stdout);
usleep(12000);
putc('\r', stdout);
@bierbaum
bierbaum / o.scala
Created June 8, 2012 17:53
ostrich examples
// Admin Stuff
object Admin {
val handlers = new MutableHashMap[String, CgiRequestHandler]
def register(config: AdminServiceConfig) {
config.extraHandlers = handlers
}
object Hi extends CgiRequestHandler {
@bierbaum
bierbaum / openssl-1.0.0g-npn.patch
Created February 8, 2012 19:18
OpenSSL 1.0.0g NPN Patch (github.com/jpinner)
diff -rupN openssl-1.0.0g/apps/apps.c openssl-1.0.0g-npn//apps/apps.c
--- openssl-1.0.0g/apps/apps.c 2011-03-19 02:44:25.000000000 -0700
+++ openssl-1.0.0g-npn//apps/apps.c 2012-02-08 11:07:50.667074885 -0800
@@ -2693,6 +2693,48 @@ void jpake_server_auth(BIO *out, BIO *co
#endif
+/* next_protos_parse parses a comma separated list of strings into a string
+ * in a format suitable for passing to SSL_CTX_set_next_protos_advertised.
+ * outlen: (output) set to the length of the resulting buffer on success.
. .
. . IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.IMMMMMMMMMMMMMM8I . ... . =MMMM
:MMMMMMMMMZ . 7MMMMZ . 7MD . IMMD .
MMMMM. . . . .~ .M, . MMM .
MMMM, N. .IDMMMO777ZNMMMMMO =MM . M:. NMM.
. ZMMM . . :7NMMDI= . MM IM MMM
MMM IMM77IDMMM, . M8 ..MM M ,N MMM
M8 M M . M ,O . 7. MM
.M8 D ,.
#!/bin/bash
MAXBRANCHES=30
function __list {
git reflog | grep ': checkout:' | awk '{print $8}' | grep -v submit_branch | uniq | head -$MAXBRANCHES | sort | uniq -c | sort -nr | awk '{print $2}' | cat -n
}
git branch 2>&1 > /dev/null || exit 1