Skip to content

Instantly share code, notes, and snippets.

View bengl's full-sized avatar
💭
Set your status

Bryan English bengl

💭
Set your status
View GitHub Profile
@bengl
bengl / .gitconfig
Created May 6, 2014 01:31
handy way to create npm module releases
[alias]
lasttag = describe --abbrev=0 --tags
releasenotes = !bash -c 'git shortlog --no-merges HEAD --not $(git lasttag)'
release = !bash -c 'echo \"%s\n\n$(git releasenotes)\" | xargs -0 npm version $0 -m'
@bengl
bengl / output.txt
Created April 1, 2014 18:17
randomized mock data tests
$ mocha test.js
0 passing (4ms)
1 failing
1) RandomStuff should work for all of mockData:
Error: 2/6 failed
at Context.<anonymous> (/Users/benglish/testcrap.js:26:19)
@bengl
bengl / keybase.md
Created March 7, 2014 06:15
keybase.md

Keybase proof

I hereby claim:

  • I am bengl on github.
  • I am bengl (https://keybase.io/bengl) on keybase.
  • I have a public key whose fingerprint is 12DA A122 E4B0 3089 0F5D A100 02E1 DF2D F935 CE6D

To claim this, I am signing this object:

@bengl
bengl / redis.rb
Created February 7, 2014 23:51
Homebrew script for DeNA's fork of redis
require 'formula'
class Redis < Formula
homepage 'http://redis.io/'
url 'http://download.redis.io/releases/redis-2.8.5.tar.gz'
sha1 'f0eb48609ff66ead3c7f06bbe8a8dd1aa7341b73'
bottle do
sha1 "3670032929123972994cdc29374628311e5fb874" => :mavericks
sha1 "9240b55f06576409d8f9e9f6f4d00d67a6861da0" => :mountain_lion
@bengl
bengl / README.md
Last active December 29, 2015 11:19
Can't use repl inside domain. Or can I? I'm not sure.

It turns out that the node REPL doesn't seem to behave as expected inside a domain. (I'm using node v0.10.22)

Try running repltest.js, which is narrowed down from a much larger REPL-thing I'm working on. You'll get your REPL, but there is some weirdness. If you give it an empty line (i.e. just press Enter/Return), you'll get a syntax error, captured by the domain and ouput via line 6:

> 
SyntaxError: Unexpected token )
    at REPLServer.self.eval (repl.js:112:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
@bengl
bengl / be.txt
Created November 6, 2013 17:03
I swear it's not the logo for Bugatti.
#################################
###################################
####################################
##### #### ####
##### #### ####
#### ####
#### ####
#### #### ####
##### #### ####
@bengl
bengl / stuff.js
Created September 27, 2013 16:25
var app = express();
app.get('/', function(req, res){
try{
if (someBoolean) {
res.send("all good!")
} else {
throw Error("shit's fucked, yo");
}
} catch (e){
res.send(e.toString(), 500);
@bengl
bengl / test.js
Last active December 10, 2015 23:08
domains don't really catch exceptions?
// node >= 0.8.*
var domain = require('domain');
process.on('uncaughtException', function(error){
console.error('UNCAUGHT!', error);
});
var d = domain.create();
d.on('error', function(error) {
@bengl
bengl / LICENSE.txt
Created December 13, 2012 10:00 — forked from 140bytes/LICENSE.txt
Do A Barrel Roll!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bengl
bengl / Makefile
Created September 19, 2012 08:08
A simple C program that emits QR codes as ANSI art
CFLAGS=-Wall
all:
$(CC) $(CFLAGS) qransi.c -lqrencode -o qransi