Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
jbrechtel / composition.js
Last active February 26, 2019 15:59
generators?
function mapComp(array, fn) {
var result = [];
for(var i = 0; i < array.length; i++) {
result.push(fn(i));
}
return result;
}
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
<html>
<body>
<div style="color:white">
<a>foo</a>
</div>
</body>
</html>
@jbrechtel
jbrechtel / 0_reuse_code.js
Created June 9, 2014 13:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#mongo 2.4 running with --auth
require 'mongo'
require 'json'
client = Mongo::MongoClient.new('localhost', 27017)
admin = { user: 'admin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'clusterAdmin'] }
user = { user: 'app', pwd: 'password', roles: ['readWrite'] }
module James
open System
let strToInt str =
try
Some (Int32.Parse(str))
with
| _ -> None
module james
let rec fib = function
| 0 -> 0
| 1 -> 1
| n -> fib(n - 1) + fib(n - 2)
type Thing =
| Something = 1

Keybase proof

I hereby claim:

  • I am jbrechtel on github.
  • I am eightball (https://keybase.io/eightball) on keybase.
  • I have a public key whose fingerprint is 1535 B447 793A DC4B EE01 66D2 803B CB2D EF34 8B88

To claim this, I am signing this object:

Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
@jbrechtel
jbrechtel / README.md
Created November 23, 2013 21:23
Generate and search for available twitter usernames

What?

This helps you search for available twitter usernames.

Why?

I really want a twitter username that matches my nickname instead of my realname. Most of the good formulations of my nickname are taken so I wanted to find something with an _ or 1 placed in a non-annoying spot. There are a lot of permutations so I decided to generate them and then search automatically.

Using