Skip to content

Instantly share code, notes, and snippets.

View steven-ferguson's full-sized avatar

steven-ferguson

  • Dave
  • Los Angeles, CA
View GitHub Profile
class ScheduledStop
attr_reader :time, :stop_id, :id
def initialize(attributes)
@time = Time.new(2013, 9, 12, attributes['time'][0..1].to_i, attributes['time'][3..4].to_i)
@stop_id = attributes['stop_id'].to_i
@id = attributes['id'].to_i
end
require 'pg'
require 'date'
require './lib/person'
require './lib/marriage'
require './lib/parent'
DB = PG.connect(:dbname => "family_tree")
def welcome
@steven-ferguson
steven-ferguson / gist:8567906
Created January 22, 2014 21:41
Object.create vs new Object with object literal notation
var Foo = {
prop: 'A'
}
var bar = Object.create(Foo);
var bad = new Object(Foo);
//These are false
console.log(Foo === bar);
console.log(bar === bad);
@steven-ferguson
steven-ferguson / gist:9083414
Last active August 29, 2015 13:56
Book Data Merger
require 'json'
class BookMetaMerge
def initialize(output_file='result_example.file')
@output_file = output_file
end
def merge_files(file1, file2)
hash_one = JSON.parse(file1)
hash_two = JSON.parse(file2)
@steven-ferguson
steven-ferguson / firebase-ui-auth.js
Created July 12, 2016 23:59
Emberfire + FirebaseUI Authentication
/* globals firebaseui */
import Ember from 'ember';
import firebase from 'firebase';
const { computed, inject: { service } } = Ember;
export default Ember.Component.extend({
firebaseApp: service(),
didInsertElement() {

Keybase proof

I hereby claim:

  • I am steven-ferguson on github.
  • I am stevenferguson (https://keybase.io/stevenferguson) on keybase.
  • I have a public key ASBza5c1q8UuX5ERqSR1HgkoPxOkl2ju8zLETmhkHWfZlgo

To claim this, I am signing this object:

@steven-ferguson
steven-ferguson / scenario.md
Last active April 17, 2020 19:11
Phone number and email Patch

Given the following state:

  • User A (id: 'a') with the following documents
documents: [{
  "id": "a_123"
  "email": "[email protected]",
  "phone_number": "901.111.1111",
  ...
}]