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
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
@michaelkirk
michaelkirk / some_scraping_job.py
Last active Aug 29, 2015
example of how I might parallelize something using fork in python
View some_scraping_job.py
#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
michaelkirk / mkirk-pubkey.asc
Created Jun 27, 2014
mkirk's public GPG key
View mkirk-pubkey.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.13 (Darwin)
mQENBFICeeoBCADAaV2yoK4kNUWm83PwoHv1GSPaWK1H03Zp5vauJvy2Wge+A08e
S3wXH4jCBV7s1AQDP+wW9FsAU4w/UIctAFFH7DrHdNuEVfi2GNLf6BMQll0LbW83
Gssw34Tffnogf/DttrN46t4Zoa0wI9BVZaUqYsp+seGLJ48/imykUBgXxXc8P05d
bFvC0TMgMRWvR3R33Os3eNPq/6GSID+cfluYRwc3DT9aMCMiFLUz9PEeJTxmCs7K
ObB0sJNakeMHefuYZaqrULLG5lD7h0dLXcU319MOQ2McEKb2Ry6w0hI9Dkk4uk8U
2xQUtEhhww9evxQtWIYELwPpN0DNRyPwjFwfABEBAAG0Kk1pY2hhZWwgS2lyayA8
bWljaGFlbC5qb2huLmtpcmtAZ21haWwuY29tPokBOAQTAQIAIgUCUgJ56gIbAwYL
@michaelkirk
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; }
View plugin.rb
require 'yaml'
module MyPlugin
SETTINGS = YAML.load './plugins/my_plugin/settings.yml'
end
View UnMarshaller.java
package com.getinsured.parser;
import gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType;
import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
@michaelkirk
michaelkirk / gist:6849441
Created Oct 6, 2013
Add items to the Navigation Bar
View gist:6849441
availableNavItems: function() {
var loggedOn = !!Discourse.User.current();
var extraNavItem = Discourse.NavItem.fromText("foo", {
loggedOn: loggedOn
});
return Discourse.SiteSettings.top_menu.split("|").map(function(i) {
return Discourse.NavItem.fromText(i, {
loggedOn: loggedOn
View .ackrc
--nosql
--ignore-file=match:tags
--ignore-dir=.idea
--ignore-dir=node_modules
--ignore-dir=.env
--ignore-dir=tmp
--ignore-dir=build
--ignore-dir=log
--ignore-dir=tiny_mce
--ignore-dir=tmp/capybara/
@michaelkirk
michaelkirk / .rspec
Created Jun 18, 2013
This is my .rspec file (lives in the project root). I always recommend running with --profile, in the hope that _maybe_ if we have to see which tests are the slowest we might accidentally fix them.
View .rspec
-c
--drb
--profile
@michaelkirk
michaelkirk / latimes_paywall_breaker.js
Last active Dec 17, 2015
break through the LA Times pay wall by pasting this into your browsers javascript console
View latimes_paywall_breaker.js
$('.dialog-wrapper').remove()
$('.dialog-overlay').remove()
You can’t perform that action at this time.