This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/zsh | |
# get hfsdebug-lite at http://www.osxbook.com/software/hfsdebug/ | |
parse-hfsdebug-path () { sed -n '/^ path /s/^.*://p' } | |
parse-hfsdebug-prev () { sed -n '/^ ownerID /s/^.* = \([0-9]*\).*/\1/p' } | |
parse-hfsdebug-next () { sed -n '/^ groupID /s/^.* = \([0-9]*\).*/\1/p' } | |
hardlinks () { | |
hfsdebug=$(whence hfsdebug-lite || whence hfsdebug) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makes sure fn gets called when bm_id is removed, whether it was a direct kill | |
// or it got caught in collateral damage from a recursive bookmark removal spree | |
function addBookmarkRemoveListener(bm_id, fn) { | |
// as we won't get an onRemoved callback for bm_id when any of its parents got | |
// removed recursively, keep a list of all its parents to know when to fire fn | |
function indexParentsFor(bm_id, bookmarks) { | |
function bookmarkParents(id, bms, path) { | |
////console.log('bookmarkParents(', id, bms, path, ')'); | |
for (var i = 0, bm, found; bm = bms[i]; i++) { | |
if (bm.id === id) return path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This block of code injects our source in the content scope and then calls the | |
// passed callback there. The whole script runs in both GM and page content, but | |
// since we have no other code that does anything, the Greasemonkey sandbox does | |
// nothing at all when it has spawned the page script, which gets to use jQuery. | |
// (jQuery unfortunately degrades much when run in Mozilla's javascript sandbox) | |
(function(run_me_in_page_scope) { | |
if ('undefined' == typeof __RUNS_IN_PAGE_SCOPE__) { // unsandbox, please! | |
var src = arguments.callee.caller.toString(), | |
script = document.createElement('script'); | |
script.setAttribute("type", "application/javascript"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Query page javascript for the identifier "name", and call callback(value), | |
// when found, or undefined, if not found or some error occurred. This works | |
// only for values that can be JSON serialized -- numbers, strings, booleans, | |
// null, or nested structures like Arrays and Objects that only contain above | |
// mentioned types of data. | |
function queryContentVar(name, callback) { | |
// makes a random 20-char lowercase id | |
function random() { | |
var rand = ''; | |
while (rand.length < 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Std; | |
use File::Basename; | |
use JSON; | |
use utf8; | |
my $prog = basename($0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
require 'digest/md5' | |
require 'net/http' | |
require 'uri' | |
$unknown_gravatar = 'd5fe5cbcc31cff5f8ac010db72eb000c' | |
$email_addr_regex = /[^\[{(< @"']+@[^\]})> @"']+\.[^\]})> @"']+/ | |
def md5(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enumerate your own list of goog.require:s, if you want something else than TableSorter and XhrIo. | |
// Similarly, you can pass a callback that will get the library in its first parameter, once loaded, | |
// or leave it as is, if you'd rather overwrite the top window's "goog" with your own custom version. | |
javascript:(function(requires, callback) { | |
var base = 'http://closure-library.googlecode.com/svn/trunk/closure/goog/' | |
, iframe = document.body.appendChild(document.createElement('iframe')); | |
iframe.src = 'about:blank'; | |
iframe.style.display = 'none'; | |
iframe.contentWindow.cb = callback; | |
iframe.contentDocument.write('<head><script src="'+ base +'base.js"></script><script src="'+ base + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var steps = 0 // steps drawn on the current element, so far | |
, info = document.getElementById('next_step') | |
, svgs = [].slice.call(document.getElementsByTagName('svg')) | |
, svg, walker, current; | |
function lexSVGPath(d) { | |
function command(seg) { | |
var cmd = seg.match(/[a-z]/i), arg, cnt; | |
if (cmd) { | |
cmd = cmd[0]; // which subcommand |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.