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 data = { | |
_xpcom: Cc['@mozilla.org/preferences-service;1'] | |
.getService(Ci.nsIPrefService) | |
.getBranch('opendns.'), | |
get: function(k) { | |
var t = this._xpcom.getPrefType(k); | |
var fn; | |
if (Ci.nsIPrefBranch.PREF_BOOL == t) { fn = 'getBoolPref'; } |
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/sh | |
ipfw add deny udp from any to any 2222 | |
ipfw add deny udp from any to any 2223 |
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/env python | |
""" | |
Django Shell Script | |
Richard Crowley <[email protected]> | |
I like organized directory structures. Because of the way the Python | |
path works, there wasn't a readily-available way to stash shell scripts | |
that needed access to Django goodness away in bin/. This is a bit | |
heavy on the scaffolding code (six lines, geez) but works. |
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/sh | |
# | |
# Drizzle dependency installer for Ubuntu Intrepid | |
# Richard Crowley <[email protected]> | |
# | |
if [ "." != $(dirname "$0") ] ; then | |
echo "[deps.sh] you must run deps.sh from the directory it is in" >&2 | |
exit 1 |
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/sh | |
# Haystack/Whoosh setup | |
WD=$(pwd) | |
cd /tmp/ | |
svn co http://svn.whoosh.ca/projects/whoosh/trunk whoosh | |
cd whoosh | |
sudo python setup.py install | |
cd .. ; sudo rm -rf whoosh |
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
// ==UserScript== | |
// @name MySQL Linkify | |
// @namespace rcrowley.org | |
// @description Restyle <code> tags within <a> tags to reduce confusion | |
// @include http://*mysql.com/* | |
// ==/UserScript== | |
(function() { | |
var a = document.getElementsByTagName('a'); | |
for (var i = 0; i < a.length; ++i) { |
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/sh | |
# Haystack/Solr setup | |
# On a Mac you've already got Java but on Ubuntu, you need it | |
if [ -z "$(uname -a | grep Darwin)" ] ; then | |
sudo apt-get install --no-install-recommends sun-java6-jre | |
fi | |
WD=$(pwd) | |
cd /tmp/ |
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
// Pageview/click analytics in Cassandra? | |
{ | |
"pageviews": { // Column family | |
"cookie": "OH HAI", | |
"url": "/foo/bar", | |
"layout": 47, | |
"ip": "1.2.3.4" | |
// And we get timestamps for free! | |
}, |
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
function obj2ul(obj) { | |
var ul = document.createElement('ul'); | |
if ('object' == typeof obj) { | |
for (var k in obj) { | |
var li = document.createElement('li'); | |
if ('object' == typeof obj[k]) { | |
li.appendChild(document.createTextNode(k + ':')); | |
li.appendChild(obj2ul(obj[k])); | |
} else { | |
li.appendChild(document.createTextNode(k + ': ' + obj[k])); |
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
<?php | |
function curl_quickie($url, $post = false, $cookie = false, | |
$return_headers = false, $print = false) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 10); | |
curl_setopt($ch, CURLOPT_MAXREDIRS, 10); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
if (false !== $post) { |
OlderNewer