Skip to content

Instantly share code, notes, and snippets.

View pdubroy's full-sized avatar

Patrick Dubroy pdubroy

View GitHub Profile
#!/bin/bash -e
# Get depot_tools.
command -v gclient >/dev/null 2>&1 ||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cat >> $HOME/.bashrc <<EOF
# Added by $(basename $0)
export PATH=$PWD/depot_tools:$PATH
EOF
@pdubroy
pdubroy / bar.js
Created October 16, 2013 07:31
A demonstration of "dependency hell" -- in particular, the problem of conflicting dependencies.
var x = require('x-1.3');
var foo = require('foo');
// Doesn't work because x is expecting v1.2 of the Thing interface.
foo.wiggle(x.makeThing());
@pdubroy
pdubroy / gist:6222091
Last active December 21, 2015 00:39
Script to run in the dev tools console to collect history entries from the Chrome history page.
var visits = [];
var count = 0;
(function getVisits() {
visits = visits.concat(Array.prototype.slice.call(document.querySelectorAll('.title a')));
console.log(visits.length + ' visits');
if (++count < 10) setTimeout(getVisits, 2000); // Stop after 10 pages.
$('older-button').click();
}());
@pdubroy
pdubroy / FixMacBookPro.ahk
Created October 7, 2009 20:27
AutoHotkey script to make life nicer when running Windows on a MacBook. Built and tested on my mid-2009 13" Unibody MacBook Pro, with Boot Camp 3.0.
; AutoHotkey script to make life nicer when running Windows on a MacBook.
; Built and tested on my mid-2009 13" Unibody MacBook Pro, with Boot Camp 3.0.
; Written by Patrick Dubroy <pdubroy@gmail.com>; please enjoy and modify.
; For common key combinations, make Cmd-<key> the same as Ctrl-<key>
#c::^c ; Copy
#x::^x ; Cut
#v::^v ; Paste
#s::^s ; Save