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
# copy this to ~/.bashrc | |
_complete_ssh_hosts () { | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=` | |
grep "^host " ~/.ssh/config | \ | |
awk '{print $2}' | |
` | |
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur)) |
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 | |
import os | |
import feedparser | |
import pprint | |
import subprocess | |
TED_FEED = "http://feeds.feedburner.com/tedtalks_video" | |
def need_to_download(entries): | |
for entry in entries: |
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/bash | |
### BEGIN INIT INFO | |
# Provides: riak | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
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
def pbcopy(string) | |
pasteBoard = NSPasteboard.generalPasteboard | |
pasteBoard.declareTypes([NSStringPboardType], owner: nil) | |
pasteBoard.setString(string, forType: NSStringPboardType) | |
end |
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/bash | |
# This utility is useful for extracting the field names from a SQL to CSV export | |
# | |
# csvheadpivot will scan the current working directory for CSV files. When it | |
# encounters a CSV file the utility assumes the CSV file has a header row and | |
# any CSV files with more than one row has data. | |
# | |
# When encountering a CSV with data, the utility will grab the header row and | |
# pivot it to a single column. |
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 | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
<html> | |
<head></head> | |
<body> | |
<p><textarea cols=100 rows=25 id="output"></textarea></p> | |
</body> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var client = new function() { | |
var lastid=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
(toy)$ node --trace-gc ToyServer.js | |
Scavenge 1.0 -> 1.0 MB, 1 ms. | |
Scavenge 1.9 -> 1.8 MB, 0 ms. | |
Toy Server initialized at port 8000 | |
Scavenge 2.1 -> 2.1 MB, 1 ms. | |
Mark-sweep 2.1 -> 1.8 MB, 3 ms. | |
Mark-compact 1.8 -> 1.8 MB, 8 ms. | |
Scavenge 2.5 -> 2.1 MB, 0 ms. | |
Scavenge 2.6 -> 2.2 MB, 0 ms. | |
Scavenge 2.8 -> 2.4 MB, 0 ms. |
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
Example = fun(Arg) -> | |
case Arg of | |
ohai -> | |
io:format("OHAI!~n"); | |
foo -> | |
io:format("Foo!~n"); | |
bar -> | |
io:format("Bar!~n"); | |
_EverythingElse -> | |
io:format("~p~n",[_EverythingElse]) |
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 | |
from optparse import OptionParser | |
from xml.dom.minidom import parse | |
import os | |
import sqlite3 | |
datatypeMap = { | |
'integer': 'INT', | |
'datetime': 'DATETIME', |
OlderNewer