Skip to content

Instantly share code, notes, and snippets.

@paulschreiber
paulschreiber / nv-early-voting.rb
Created October 6, 2012 18:21
Nevada early voting locations scraper
#!/usr/bin/ruby
require 'rubygems'
require 'mechanize'
require 'yaml'
agent = Mechanize.new
county_url_map = {}
@paulschreiber
paulschreiber / gist:2512309
Created April 27, 2012 19:54
bundle error
$ bundle --verbose install --gemfile /var/web/turbovote/releases/20120427191914/Gemfile --path /var/web/turbovote/shared/bundle --deployment --without development test
Fetching source index for http://rubygems.org/
Fetching git://github.com/paulschreiber/pdf-stamper.git
Git error: command `git clone 'git://github.com/paulschreiber/pdf-stamper.git' "/var/web/turbovote/shared/bundle/jruby/1.8/cache/bundler/git/pdf-stamper-b8ae2b75b9456a74e2d52048cca51585da1dcd16" --bare --no-hardlinks` in directory /var/web/turbovote/releases/20120427191914 has failed (127).
/usr/local/lib/jruby-1.6.6/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/source.rb:584:in `git'
/usr/local/lib/jruby-1.6.6/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/source.rb:653:in `cache'
/usr/local/lib/jruby-1.6.6/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/source.rb:551:in `specs'
/usr/local/lib/jruby-1.6.6/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/lazy_specification.rb:48:in `__materialize__'
/usr/local/lib/jruby-1.6.6/lib/ru
@paulschreiber
paulschreiber / tmobilepaperless.txt
Created March 23, 2012 20:41
T-Mobile paperless billing help
I was reading "Paperless Billing":
http://support.t-mobile.com/docs/DOC-1784
Under "Sign up for Paperless Billing", it says:
To sign up for Paperless Billing, perform the following steps:
Log in to My T-Mobile.
On My T-Mobile, hover over Manage and then select Your Profile.
Under Bill Delivery Options, click the Switch to paperless billing link to begin the registration process.
However, I don't see "Bill Delivery Options" anywhere on my profile page.
@paulschreiber
paulschreiber / htaccess
Created January 19, 2012 15:49
WordPress multisite htaccess with rails apps
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
@paulschreiber
paulschreiber / wp-upload-handle.html
Created December 30, 2011 16:03
WordPress upload handling (PHP)
<div class="submit-photos padding-top">
<h2>Photos</h2>
<label for="upload-image-photo">
<input id="upload-image-photo" type="text" size="36" name="upload-image-photo" value="" />
<input id="upload-image-button-photo" class="upload-image-button" type="button" value="Upload Image" />
<br />Upload a picture of yourself
</label>
</div>
@paulschreiber
paulschreiber / rogers-router-20111227.txt
Created December 27, 2011 06:38
Pinging my Rogers router
$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@paulschreiber
paulschreiber / OntarioElection2011.txt
Created October 15, 2011 05:59
Ontario Election Results -- October 6, 2011
001 Andrew Delis Ontario Libertarian Party / Parti libertarien de l'Ontario 310
001 Joe Dickson Ontario Liberal Party / Parti libéral de l'Ontario 19606
001 Todd McCarthy PC Party of Ontario / Parti PC de l'Ontario 14738
001 Steven Toman Green Party of Ontario / Parti Vert de l'Ontario 841
001 Evan Wiseman Ontario NDP/NPD 5951
002 Mike Brown Ontario Liberal Party / Parti libéral de l'Ontario 7405
002 Joe Chapman PC Party of Ontario / Parti PC de l'Ontario 6147
002 David Hoffman Family Coalition Party of Ontario / Parti de la Coalition des Familles de l'Ontario 218
002 Michael Mantha Ontario NDP/NPD 11560
002 Justin Tilson Green Party of Ontario / Parti Vert de l'Ontario 677
# pull the base64-encoded string from foo+<base64>@domain.com
def edecode(a):
return base64.decodestring(a.split('+')[1].split('@')[0])
Grand Traverse Acme Township 6042 Acme Rd Williamsburg 49690 231-938-1350 231-938-1510 acme-tw@miqvf.org
Kent Ada Township 7330 Thornapple River Dr Ada 49301 616-676-9191 X 21 616-676-5870 ada-tw@miqvf.org
Arenac Adams Township 7461 Ward Road Sterling 48659 (989) 654-2260 arenac-co@miqvf.org
Hillsdale Adams Township 5675 Knowles Rd. North Adams 49262 517-523-3067 adams30-tw@miqvf.org
Houghton Adams Township P.o. Box 520 South Range 49963 906-482-4420 906-482-1073 adams31-tw@miqvf.org
Oakland Addison Township 1440 Rochester Rd Leonard 48367 248 628-3317 248 628-2207 addison-tw@miqvf.org
Lenawee Adrian 135 E. Maumee St. Adrian 49221 517-264-4866 517-265-8798 adrian-ci@miqvf.org
Lenawee Adrian Township 2907 Tipton Hwy Adrian 49221 517-263-7920 517-263-4162 adrian-tw@miqvf.org
Mecosta Aetna Township P.o. Box 228 Morley 49336 231-856-7091 aetna54-tw@miqvf.org
Missaukee Aetna Township 4819 S 9 Mile Rd Falmouth 49632 231-826-3797 231-826-3782 aetna57-tw@miqvf.org
#!/usr/bin/python
# By Paul Schreiber <paulschreiber at gmail.com>
# Free to use as you see fit. Credit appreciated.
#
# version 1.3
#
# Retrieved 2010-10-12:
# City and Town Clerks: http://gist.github.com/623148
# County Clerks: http://gist.github.com/623121