Skip to content

Instantly share code, notes, and snippets.

View formido's full-sized avatar
🥰

Michael Terry formido

🥰
View GitHub Profile
var urls = [
/* Attempt to contact emacs web server from outer context */
'http://localhost:8080/skewer',
/* Wildcard CORS enabled - Works in PhantomJS 1.9.0 */
'http://updates.html5rocks.com',
/* CORS disabled - Fails in PhantomJS 1.9.0 (and every other version) */
'http://www.google.com',
/* Hack workaround? */
/*
function(httpGet, callback) {
// Workaround for https://github.com/highslide-software/highcharts.com/issues/3385
// Uses default bootstrap media query sizes.
// display_heatmap is a function that displays the heatmap once the map data has been downloaded.
// Requires enquire.js (http://wicky.nillia.ms/enquire.js/)
// Download map data and save the jqXHR promise.
var states_promise = jQuery.getJSON('http://blog.statricks.com/media/system/maps/US.min.json', {});
// Use enquire to re-render the heatmap if we change browser width
#!/usr/bin/env python
import ruya, logging
def aftercrawl(caller, eventargs):
page = eventargs.document
print 'Url: ' + page.uri.url
print 'Title: ' + page.title
@formido
formido / foo
Created December 2, 2008 19:47
# TODO: may want to use core.autocrlf but not sure
git commit --no-verify -m "Updated to work at work." #override git's whitespace finickiness
# updates submodules, obviously
git submodule update
find applescript-loader-and-module-library -iname *.applescript -exec ~/bin/flip -u '{}' \;
@formido
formido / foo
Created December 12, 2008 06:21
var range = window.getSelection().getRangeAt(0);
var offset = range.startOffset;
var container = range.commonAncestorContainer;
var containerText = container.nodeValue;
bash-3.2$ wget -m -k -K -E http://url/of/web/site
wget -m -k -K -E -nv -R jpg,gif,js,css
# switch to remote
git checkout origin/master
# switch back
git checkout master