Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
@spudtrooper
spudtrooper / gmailtitle.user.js
Created April 24, 2011 18:21
Puts your gmail inbox count to the front of the window, rather than towards the back.
// ==UserScript==
// @name Gmail Title
// @namespace http://jeffpalm.com/gmailtitle
// @description Makes the gmail title somewhat useful
// @include https://mail.google.com/mail/*
// ==/UserScript==
(function() {
var ignoreNextChange = false;
@spudtrooper
spudtrooper / njtransit_alerts.rb
Created April 26, 2011 14:13
Send email alerts for NJ transit
#!/usr/bin/env ruby
#
# Sends an email about alerts for NJ transit trains.
#
# Usage:
#
# njtransit email? city?
#
# Examples:
#
@spudtrooper
spudtrooper / gist:986932
Created May 23, 2011 15:56
maketargets
#!/bin/sh
#
# Prints out the targets available to make.
#
# Usage: maketargets file?
#
# On windows probably pipe into sort and uniq, e.g.
#
# maketargets | sort | uniq
#
@spudtrooper
spudtrooper / self_ref_cowsay
Created May 23, 2011 20:03
Self-referencial cowsay
#!/bin/sh
n=`which cowsay` && $n "`cat $n`"
@spudtrooper
spudtrooper / macinstall
Created May 30, 2011 12:13
Tries to install something using fink, macports, and apt-get.
#!/bin/sh
#
# Tries to install something using fink, macports, and apt-get.
#
cmds="fink port apt-get"
for c in $cmds; do
test x`which $c` != 'x' && {
$c install $@
test "$?" -eq "0" && exit 1
@spudtrooper
spudtrooper / Cygwin.bat
Created June 8, 2011 17:35
cygwin that doesn't suck as much
@echo off
C:
cd c:\cygwin\bin
REM bash -login -i
rxvt -km ISO-8859-15 -sl 2500 -sb -geometry 90x30 -tn rxvt -fn 'Lucida Console-14' -sr -e /usr/bin/bash --login -i
@spudtrooper
spudtrooper / print_possible_printer_ports
Created August 18, 2011 15:58
Print possible printer ports
#!/bin/sh
awk -F/ '/tcp.*print|print.*tcp/ {gsub(/.*[ \t]/,"",$1); print $1}' /etc/services
@spudtrooper
spudtrooper / ebaypages.js
Created August 21, 2011 01:27
Ebay pages -- display the first item in a paginated ebay search, so you can jump into the desired section of the search results.
//
// Displays a window listing the first item in every page for a
// paginated ebay query. This allows you to jump into the desired
// section of en ebay query, rather than browsing through pages and
// pages. For example, you search for an item yielding 1000s of pages
// of results with bidding periods ranging from seconds to days, and
// you're willing to wait a couple days -- so you sort by 'time left'.
// Instead of clicking through the pages until you find the results
// that have a couple days, you could directly to that page. There is
// more here:
@spudtrooper
spudtrooper / search_jars
Created August 27, 2011 18:57
Searches a list of jar files for a given package or class
#!/bin/sh
#
# Searches a list of jar files for a given package or class and prints
# the jar file that contains files in that package. The first
# argument is the package for which we search, the rest are jar files
# to search. Examples searching for a (1) package and (2) class:
#
# search_jars org.apache.http *.jar # (1)
# search_jars HttpExecutionContext *.jar # (2)
#
@spudtrooper
spudtrooper / check_for_video_experimenter
Created August 28, 2011 20:53
Mails the USER or email you pass in if the video experimenter from # nootropicdesign.com is back in stock
#!/bin/sh
#
# Mails the USER or email you pass in if the video experimenter from
# nootropicdesign.com is back in stock. Put this in your crontab to
# periodically check.
#
to=$1
to=${to:=$USER}
link="http://nootropicdesign.com/store/index.php?main_page=product_info&cPath=1&products_id=24"
res=$(curl -s $link | grep -l "Out of Stock")