Skip to content

Instantly share code, notes, and snippets.

View timrogers's full-sized avatar

Tim Rogers timrogers

View GitHub Profile
@timrogers
timrogers / gist:ef7a0070d29ea1ffa5d925184e7a4887
Created July 23, 2020 10:29
Example fare rules for an American Airlines flight from New York to San Francisco, with fare basis code NVAKZNM3
Rule Application
PTC - ADT
TARIFF/RULE - 011/M11K
ROUTING NUMBER - 304/TYPEPrice/DEP**JFK/ARR**SFO/:CT1(JFK):CT2(SFO):ITA
ONE WAY INSTANT PURCHASE FARES N
APPLIES FOR ONE WAY FARES
FOR ADULT
Flight Application
@timrogers
timrogers / herokuize.sh
Created July 31, 2016 14:23
herokuize, a script for seeding your local Rails environment from Heroku. Just specify $PG_USERNAME and $PG_DATABASE.
#!/bin/bash
heroku pg:backups capture
curl -o latest.dump `heroku pg:backups public-url`
bundle exec rake db:drop db:create
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $PG_USERNAME -d $PG_DATABASE latest.dump
rm latest.dump
@timrogers
timrogers / gist:57a67478ea575d6a7e7c
Created January 17, 2016 21:11
Sample tweet data from Twitter Streaming API
{
"created_at":"Sun Jan 17 17:52:50 +0000 2016",
"id":688781035077787650,
"id_str":"688781035077787650",
"text":"Testing with #VoteRemain",
"source":"\u003ca href=\"http://itunes.apple.com/us/app/twitter/id409789998?mt=12\" rel=\"nofollow\"\u003eTwitter for Mac\u003c/a\u003e",
"truncated":false,
"in_reply_to_status_id":null,
"in_reply_to_status_id_str":null,
"in_reply_to_user_id":null,
@timrogers
timrogers / keybase.md
Created June 29, 2015 15:15
keybase.md

Keybase proof

I hereby claim:

  • I am timrogers on github.
  • I am timrogers (https://keybase.io/timrogers) on keybase.
  • I have a public key whose fingerprint is 9115 4E7D 8C92 0876 7263 2623 A335 6FE7 DB7E 06B1

To claim this, I am signing this object:

# Load the authors from a text file of names, with one on each line...
path = ARGV[0]
authors = File.read(path).lines
# ...or just define them inline
authors = %w(foo bar baz)
def test_me_on(authors)
starred = []
@timrogers
timrogers / prayer_letter.md
Last active August 29, 2015 14:14
A prayer letter to follow up LSESU Christian Union Events Week 2015

Just wanted to send a proper message with updates and prayer points from our Events Week last week at LSE :) It's a bit of a long one, but thought the full story would be really encouraging and helps you to pray for us and all those who heard the Gospel:

  • We had 8am prayer meetings every day and it was so encouraging to see 15+ people there every morning. Please pray that everyone would continue to keep prayer central past the week, and that we'd find ways to make it even more part of CU.
  • Every day, we ran a free coffee stall on the main street through campus and flyered from there. A tonne of amazing conversations were had, but also very difficult ones from people who really reject the Gospel! But they still kept coming back and we kept pointing them to Christ. Please pray that those people would be struck by our love for them.
  • The lunchtime events were incredible! Momentum built over the week and every day our speaker, Malcolm, spoke clearly and faithfully from the gospel on topics relevant to LSE stu
direct_debit = GoCardless::PreAuthorization.find("0540QD22SKND")
direct_debit.create_bill(
name: "Invoice #123",
amount: "250.00"
)
//
// NSArray+Randomizer.m
// Crystal Ball
//
// Created by Tim Rogers on 06/05/2014.
// Copyright (c) 2014 Tim Rogers. All rights reserved.
//
#import "NSArray+Randomizer.h"
SELECT * FROM `salesforce1` WHERE `description` != 'Reversal' AND `id` IN ('85092508', '85092362', '85063063', '84817289', '85063064', '85063383', '85063384', '85037123', '85037124', '85062121', '85064887', '85064888', '85063292', '85063433', '85062482', '85062483', '85062942', '85062943', '85095302', '85049491', '85049492', '85063161', '85065160', '85065161', '85063561', '85063566', '85063582', '85063622', '85063649', '85065055', '85065224', '85063568', '85065284', '85065285', '85065349', '85065386', '85096528', '84929541', 'Tried to', '85065445', '85065483', '85065501', '85065587', '85065903', '85065940', '85065948', '85065941', '85065791', '85065792', '85065949', '85065225', '85066035', '85066068', '85066084', '85066125', '85065438', '85066133', '84934801', '84969645', '85097914', '85097915', '85098803', '85096560', '85096561', '85037628', '85066156', '85066548', '85066549', '85067236', '85067674', '85065351', '85067798', '85067799', '85068088', '85068089', '85066729', '85066730', '85101244', '85038023', '
@timrogers
timrogers / lse_renew_o_matic.rb
Last active December 25, 2015 21:59
Automatically renew library books from the London School of Economics (LSE) library from a Ruby script with the LSE Renew-o-matic
# LSE Renew-o-matic
# Renew books you've taken out from the library at LSE (the British Library of Political
# and Economic Science) just by running a Ruby script
#
# Step 1: Install the gem dependencies
# $ gem install terminal-table mechanize
# Step 2: Run, and you'll get a beautiful table at the end with the results!
require 'terminal-table'
require 'mechanize'