Skip to content

Instantly share code, notes, and snippets.

View brianmcd's full-sized avatar

Brian McDaniel brianmcd

View GitHub Profile
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# So that Chrome can run under tmux (see: http://savanne.be/804-running-karma-and-chrome-under-tmux-on-osx/)
set-option -g default-command "reattach-to-user-namespace -l bash"
set -g history-limit 50000
# quick pane cycling
gyp info it worked if it ends with ok
gyp info using node-gyp@1.0.3
gyp info using node@0.12.2 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/brianmcd/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/brianmcd/projects/contextify/build/config.gypi',
### Keybase proof
I hereby claim:
* I am brianmcd on github.
* I am brianmcd (https://keybase.io/brianmcd) on keybase.
* I have a public key whose fingerprint is 0308 2955 C7F8 815A F2AF DF5D 7E67 5AAD BA33 9F21
To claim this, I am signing this object:

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

<html>
<body>
<label for="box1">With default:</label><input type="checkbox" checked="" id="box1">
<label for="box2">Prevent default:</label><input type="checkbox" checked="" id="box2">
<script>
var box1 = document.getElementById('box1');
var box2 = document.getElementById('box2');
[box1, box2].forEach(function (box) {
box.addEventListener('click', function (e) {
@brianmcd
brianmcd / gist:3670088
Created September 7, 2012 22:01
CloudBrowser specific JSDOM commits
commit 7d7ca89c4914aec53cad62ecdbb264faa3bda5da
Author: Brian McDaniel <brianmcd05@gmail.com>
Date: Thu May 10 15:57:35 2012 -0400
update contextify dep
commit a0df4bbb8eb839d9a5ecb0adc3223063ddfe20d5
Author: Brian McDaniel <brianmcd05@gmail.com>
Date: Sat Mar 31 16:56:07 2012 -0400
@brianmcd
brianmcd / index.js
Created August 25, 2011 20:16
test for https
// This is in response to issue # 280 - scripts don't load over https.
// See: https://github.com/tmpvar/jsdom/issues/280
//
// When a transfer is done, HTTPS servers in the wild might emit 'close', or
// might emit 'end'. Node's HTTPS server always emits 'end', so we need to
// fake a 'close' to test this fix.
env_with_https : function (test) {
var https = require('https');
// Save the real https.request so we can restore it later.
var oldRequest = https.request;
@brianmcd
brianmcd / contextify_leak_js_output.txt
Created August 5, 2011 00:24
Contextify Performance
//Results from running test/jsdom/leak.js on brianmcd's fork of JSDOM which uses Contextify.
node --trace-gc leak.js
Scavenge 2.6 -> 2.3 MB, 1 ms.
Mark-sweep 3.5 -> 2.8 MB, 3 ms.
Scavenge 4.4 -> 3.9 MB, 0 ms.
Scavenge 5.9 -> 5.0 MB, 1 ms.
Mark-sweep 7.0 -> 4.8 MB, 10 ms.
Mark-sweep 8.7 -> 7.2 MB, 10 ms.
Mark-sweep 14.2 -> 9.8 MB, 16 ms.
@brianmcd
brianmcd / diff
Created July 30, 2011 19:36
JSDOM with Contextify
diff --git a/lib/jsdom/browser/index.js b/lib/jsdom/browser/index.js
index ed0eb80..c9c4501 100644
--- a/lib/jsdom/browser/index.js
+++ b/lib/jsdom/browser/index.js
@@ -7,7 +7,7 @@ var sys = require('sys'),
HTMLEncode = htmlencoding.HTMLEncode,
HTMLDecode = htmlencoding.HTMLDecode,
jsdom = require('../../jsdom'),
- vm = require('vm');
+ Contextify = require('contextify');