Skip to content

Instantly share code, notes, and snippets.

View reid's full-sized avatar

Reid Burke reid

View GitHub Profile
@reid
reid / init-without-listen.js
Last active August 29, 2015 14:03
Start hapi Pack without calling server's listen() method
// startupCallback is only called after server.listener.listen is called
server.pack.initWithoutListen = function (startupCallback) {
var pack = server.pack;
async.each(pack._caches, function (cache, next) {
cache.client.start(next);
}, function (err) {
if (err) { return startupCallback(err); }
pack._invoke("onPreStart", function (err) {
@reid
reid / syno-patch-openssl.md
Created April 9, 2014 02:12
Synology DS412+ OpenSSL patch

SSH into the box as root.

cd /volume1/@tmp
wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
./syno-i686-bootstrap_1.2-7_i686.xsh
ipkg update
@reid
reid / Vagrantfile
Last active August 29, 2015 13:57
Node.js Travis VM on OS X?
Vagrant::Config.run do |config|
# See https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Boxes for more boxes.
config.vm.box = "precise64_base"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# change default username if needed, according to your box's config.
# config.ssh.username = "travis"
config.vm.forward_port 22, 2220
@reid
reid / mdb-jsprint-segv.md
Created January 22, 2014 01:50
mdb crash on jsprint

jsprint segmentation fault

[root@ed6e311a-6fa5-6800-e7ea-bc0b217ea742 ~/y2]# mdb 2014-01-21-jsprint-segv.core
Loading modules: [ libumem.so.1 libc.so.1 ld.so.1 ]
> ::load v8
V8 version: 3.14.5.9
@reid
reid / extract.js
Created January 15, 2014 22:37
Yahoo Contacts to CSV extractor
function xtract(rootTableSelector){
var rows = [];
var csv = [];
$(rootTableSelector).each(function(){
var $t = $(this);
var row = {};
row.name = $.trim($t.find('div > span > b').text()).replace(" ", " ");
row.email = $.trim($t.find('div > .c').text());
rows.push(row);
csv.push([row.name, row.email]);
@reid
reid / yeti-debug-smartos.md
Last active December 30, 2015 15:19
Debugging Yeti on SmartOS

Yeti is a program that automates testing for the YUI open-source project.

Yeti automates browser tests without dependencies like Selenium. In CI, Yeti uses the Selenium 2.0 (WebDriver) API to start and stop browsers, but otherwise works the same way.

In CI we have:

  • Yeti client running on private CI system
  • Yeti server running on a Joyent SmartMachine
  • Web browsers hosted by Sauce Labs that connect to the Yeti server
@reid
reid / README.md
Created June 18, 2013 17:39
Yeti with echoecho

Steps to reproduce

  1. git clone https://github.com/yui/yeti.git
  2. cd yeti
  3. npm install
  4. Save io.html into test/functional/fixture
  5. yeti test/functional/fixture/io.html

It works!

@reid
reid / gist:5544513
Created May 8, 2013 23:39
BrowserStack browsers
[ { os_version: 'Lion',
browser: 'chrome',
device: null,
os: 'OS X',
browser_version: '14.0' },
{ os_version: 'Lion',
browser: 'chrome',
device: null,
os: 'OS X',
browser_version: '16.0' },
@reid
reid / gist:4446914
Created January 3, 2013 20:29
Stay connected to IM when you lose network connection. Put this into your crontab.
tell application "System Events" to if (processes whose name is "Messages") exists then tell application "Messages" to log in
is_claimed: false,
distance: 292.5372758964216,
mobile_url: 'http://m.yelp.com/biz/freddie-js-bar-and-lounge-san-jose',
rating_img_url: 'http://s3-media1.ak.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png',
review_count: 71,
name: 'Freddie J\'s Bar & Lounge',
snippet_image_url: 'http://s3-media1.ak.yelpcdn.com/photo/Z3vuzLbz04snzNFOcr3RUQ/ms.jpg',
rating: 3.5,
url: 'http://www.yelp.com/biz/freddie-js-bar-and-lounge-san-jose',
location: [Object],