Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
@spudtrooper
spudtrooper / twittercowsay
Created February 21, 2014 13:04
Prints a user's twitter stream using cowsay.
#!/bin/sh
#
# Prints a user's twitter stream using cowsay.
#
# Usage:
#
# % twittercowsay <user>
#
# http://jeffpalm.com/twitterer
#
@spudtrooper
spudtrooper / twitter-favorite-loop.js
Last active August 29, 2015 14:03
Bookmarklet to favorite tweets on a page with a frequency of 5 seconds.
/*
* Bookmarklet to favorite tweets on a page with a frequency of 5 seconds.
*
* Usage
* =====
* Copy the link "Favorite tweets" from http://jsfiddle.net/bfCnZ/1/ to your
* toolbar and this will favorite items at a frequency of 5 seconds.
*/
(function() {
@spudtrooper
spudtrooper / tmux.cheat
Last active August 29, 2015 14:06 — forked from afair/tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@spudtrooper
spudtrooper / redditcast.js
Created January 10, 2015 19:07
Bookmarklet to view reddit with a sidebar and send the images to a chrome cast.
(function() {
/*
* Bookmarklet to view reddit with a sidebar and send the images to a chrome
* cast. To use:
*
* 1. Go to http://reddit.com/r/pics
* 2. Start casting
* 3. Click the link in http://jsfiddle.net/erkdp48b/
*
* When you click links on the left, the images will be sent to your
@spudtrooper
spudtrooper / pandoradio
Created February 13, 2011 01:38
Prints out rd.io links of artists you listen to on pandora.com
#!/bin/sh
tshark=/Applications/Wireshark.app/Contents/Resources/bin/tshark
$tshark -i "en1" -x -f "ip src pandora.com" | awk -F" " '/^$/ {print} /^[0-9a-f]{4}/ {printf("%s",$2)}' | perl -n -e 'm/".name"\s*\:\s*"([^"]+)"/ && ($n=$1) || ($n=~s/\s+/%20/g) && print "http://www.rdio.com/#/search/$n/artists/\n"'
@spudtrooper
spudtrooper / .applications.sh
Created February 27, 2011 17:45
Creates aliases for all your mac applications without name clashes. e.g. 'preview' would open '/Applications/Preview.app'. To use, add this to your .bashrc.
#
# Creates aliases for all your mac applications in $PATHS (defined
# below) without name clashes. e.g. 'preview' would open
# '/Applications/Preview.app'. To use, add this to your .bashrc.
#
# if [ -f ~/.applications.sh ]; then
# . ~/.applications.sh
# fi
#
PATHS="/Applications /Developer/Applications"
@spudtrooper
spudtrooper / alert
Created March 1, 2011 21:21
Pops up a little window programmatically.
#!/usr/bin/env jruby
#
# Pops up a little alert window.
#
require 'java'
JFrame = javax.swing.JFrame
JPanel = javax.swing.JPanel
JLabel = javax.swing.JLabel
@spudtrooper
spudtrooper / githubrepl
Created March 8, 2011 04:51
Repl for exploring github.com
#!/usr/bin/env ruby
# -*- ruby -*-
#
# Repl for exploring git. More here:
#
# http://www.jeffpalm.com/blog/archives/002194.html
#
require 'rubygems'
require 'hubruby'
@spudtrooper
spudtrooper / undotar
Created April 8, 2011 15:36
If you ever untar a tarball that doesn't contain a directory of files, instead a bunch of files, and you want them all in one directory, this will remove the files extracted from that tarball that were extracted.
#!/bin/sh
#
# Removes the files that were extracted locally from a tar file. This
# can be used when a tarball doesn't contain a directory of files and
# extracts a bunch of files into the pwd.
#
# Example:
#
# % undotar file.tar
# % undotar file.tar.gz
@spudtrooper
spudtrooper / chromeHistoryImages.html
Created April 15, 2011 13:36
inline images in chrome history
<a href='javascript:(function() {function main() {var width=300;var as=document.getElementsByTagName("A");for (var i=0; i<as.length; i++) {var a=as[i];var src=a.href;var el=document.createElement("DIV");var img=document.createElement("IMG");img.src=src;img.setAttribute("src",src);img.width=width;img.setAttribute("width",width);el.appendChild(img);a.parentNode.appendChild(el);}}main();})();'>chrome history images</a>