Skip to content

Instantly share code, notes, and snippets.

View smerrill's full-sized avatar
🤖
Attention is all you need

Steven Merrill smerrill

🤖
Attention is all you need
View GitHub Profile
8:51:22 AM smerrill: ohai\n
8:51:25 AM smerrill: s/./&/
8:51:26 AM n00b_sedbot: What smerrill meant to say was:
8:51:26 AM n00b_sedbot: ohai
8:51:37 AM smerrill: s/$/, dudes!/
8:51:38 AM n00b_sedbot: What smerrill meant to say was:
8:51:39 AM n00b_sedbot: ohai, dudes!
8:51:39 AM n00b_sedbot: , dudes!
8:51:39 AM n00b_sedbot: , dudes!
8:51:45 AM smerrill: s/$/, dudes!/
var command = sprintf("echo '%s' | /usr/local/bin/gsed -e '%s'",
last_said[message.user].replace("'", "'\"'\"'"),
result[1].replace("'", "'\"'\"'"));
brew install lorem; lorem -l 108 -q 10 | say
var sys = require("sys"),
http = require("http"),
growl = require("./node-growl/lib/growl"),
child_process = require("child_process");
function createClient() {
var i = http.createClient(80, website);
// Handle a connection error.
// Thanks to http://rentzsch.tumblr.com/post/664884799/node-js-handling-refused-http-client-connections.
ctags --langmap=php:.engine.inc.module.theme.php.install.test.profile \
--php-kinds=cdfi \
--languages=php \
--recurse \
--exclude="\.git" \
--exclude="\.svn" \
--exclude="\.hg" \
--exclude="\.bzr" \
--exclude="\CVS" \
--totals=yes \
@smerrill
smerrill / minify.sh
Created May 5, 2011 22:31
Minify js/css in this directory and all subdirectories.
gfind . -type f -name *.css -print0 | xargs -0 yuicompressor -o '.css$:.css'
gfind . -type f -name *.js -print0 | xargs -0 yuicompressor -o '.js$:.js'
hg status | gawk '/^M/ { print $2; }' | egrep -L 'filefield_paths|ffp' | xargs hg revert --no-backup
@smerrill
smerrill / gist:955566
Created May 4, 2011 16:57
Play / Pause Amazon Cloud Player
tell application "System Events"
set frontmost_app to item 1 of (get name of processes whose frontmost is true)
end tell
tell application "Google Chrome"
activate
set i to 0
repeat with t in (tabs of (first window))
set i to i + 1
if title of t is "Amazon Cloud Player" then
@smerrill
smerrill / emulate-xsel-os-x.sh
Created April 26, 2011 16:10
Make X11 apps that expect xsel work with the OS X clipboard.
# Mimic xsel simply for the benefit of X11 apps.
xsel() {
if [[ $@ == "-ib" ]]; then
command pbcopy;
elif [[ $@ == '-ob' ]]; then
command pbpaste;
else
command xsel "$@";
fi
}
!.*/(CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$