Skip to content

Instantly share code, notes, and snippets.

Michael Kirk michaelkirk

Block or report user

Report or block michaelkirk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
michaelkirk / application.css
Last active Aug 29, 2015
railsgirls demo app
View application.css
body { padding-top: 100px; }
footer { margin-top: 100px; }
table, td, th { vertical-align: middle; border: none; }
th { border-bottom: 1px solid #DDD; }
michaelkirk / mkirk-pubkey.asc
Created Jun 27, 2014
mkirk's public GPG key
View mkirk-pubkey.asc
Version: GnuPG v1.4.13 (Darwin)
michaelkirk /
Last active Aug 29, 2015
example of how I might parallelize something using fork in python
#let's say there are 1,234 pages to scrape in total
last_page = 1234
#And the page numbering starts at "1"
first_page = 1
#This is the way to scrape every record in a single process
def scrape_all_pages():
scrape_page_range(first_page, last_page)
michaelkirk / start_fresh
Created Sep 2, 2014
Drop the existing database, and replace with only the seeded water fountain data.
View start_fresh
heroku pg:reset --remote production
echo "create extension postgis" | heroku pg:psql --remote production
heroku run rake db:schema:load --remote production
heroku run rake wetap:import_existing_data
View gist:948835
params = {"longitude":194.5432,"latitude":194.5432}
ct = CountThreshold.create!(params)
#was longitude assigned?
puts ct.longitude
# re populate ct from the DB based on it's ID to make sure the fields were persisted.
#was longitude persisted?
michaelkirk / gist:948842
Created Apr 29, 2011
ruby, dumb but true
View gist:948842
#this is dumb but true
irb(main):001:0> a = {:a => 1}
=> {:a=>1}
irb(main):002:0> a['a']
=> nil
irb(main):003:0> a[:a]
=> 1
def setup_test_database(variables):
# Setup the testing database
world.test_runner = django_nose.NoseTestSuiteRunner()
# Setup environment.
# Create Base DB
world.test_db = world.test_runner.setup_databases()
michaelkirk /
Created Mar 6, 2012 for lettuce, using south
from lettuce import after, before, world
from selenium import webdriver
from import call_command
from django.test.simple import DjangoTestSuiteRunner
import lettuce_webdriver.webdriver
def setup_test_database_and_env(variables):
# FIXME when path_for_test_db_setup is outside of this method,
# running ./ test explodes
michaelkirk / unoptimize_to_xs_hack.rb
Created Apr 26, 2012
work around for rails 3 to_xs
View unoptimize_to_xs_hack.rb
# work around for
class String
alias_method :to_xs, :original_xs
michaelkirk / .ackrc
Created Jun 5, 2012
get ack to search cucumbers
View .ackrc
You can’t perform that action at this time.