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
@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": "foo@gmail.com",
  "phone_number": "901.111.1111",
  ...
}]

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 / 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() {
@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 / 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);
require 'pg'
require 'date'
require './lib/person'
require './lib/marriage'
require './lib/parent'
DB = PG.connect(:dbname => "family_tree")
def welcome
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
@steven-ferguson
steven-ferguson / book.rb
Created September 12, 2013 00:55
Library App
class Book
attr_reader :title, :isbn, :author_last_name, :author_first_name, :id, :copies, :number_of_copies
def initialize(title, isbn, author_last_name, author_first_name, number_of_copies)
@title = title
@isbn = isbn
@author_first_name = author_first_name
@author_last_name = author_last_name
@number_of_copies = number_of_copies
class Address
attr_reader :contact_id, :street, :city, :state, :zip, :type, :full
def initialize(contact_id, street, city, state, zip, type="")
@contact_id = contact_id
@street = street
@city = city
@state = state
@zip = zip
@type = type
class List
attr_reader :name, :id
def initialize(name)
@name = name
end
def ==(another_list)
self.name == another_list.name