Skip to content

Instantly share code, notes, and snippets.

View FifthSurprise's full-sized avatar

Kevin Chang FifthSurprise

View GitHub Profile
@FifthSurprise
FifthSurprise / System Design.md
Created April 19, 2016 13:30 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
### Keybase proof
I hereby claim:
* I am FifthSurprise on github.
* I am fifthsurprise (https://keybase.io/fifthsurprise) on keybase.
* I have a public key whose fingerprint is 0DCF 4B72 A275 BF92 DB2C B132 58CB 6FB2 DC0B 1536
To claim this, I am signing this object:
@FifthSurprise
FifthSurprise / gist:411048ac550b6d918f13
Created June 14, 2014 20:18
Ruby005 Pigeon Solution
# Write your code here!
require 'pry'
def nyc_pigeon_organizer(pigeon_data)
result = {}
#going through the list of all the attributes
pigeon_data.each do |attributetype, attributelist|
attributelist.each do |attribute, pigeonlist|
pigeonlist.each do | pigeonname|
result[pigeonname]={} unless(result[pigeonname]) #add pigeon if not added before
if(attributetype == :color)
@FifthSurprise
FifthSurprise / gist:681b8ab50afb908431a2
Created April 30, 2014 00:40
Ruby Trivia - Gregstallings
~~Ruby Trivia
~~Question:
What is the highest level in the object model?
~Answer:
`BasicObject`
~~Question:
Is everything in Ruby an object?
@FifthSurprise
FifthSurprise / flatironretrospectives
Last active August 29, 2015 14:00
Flatiron Retrospectives
* You can run multiple instances of rails server by changing the port number: rails s -p 3001
* For learning CSS stuff - http://flukeout.github.io/
* Assume the following tables: A table of users, and a table of books.
** Outer left join is used for in the following scenario: If you had users who may have books, an outer left join would allow you to get all the users and their books, if they have them.
** Inner join would get all of the users even if they have no books and all of the books even if they have no users.
** Full outer join would be all of the users and all of the books whether they have an associated book or user.
* When :js => true when using Caybara and Javascript, you need to make sure the database is truncation instead of transaction since a separate thread is spun off during testing.
* Ruby Trivia: https://github.com/gregstallings/ruby-trivia
@FifthSurprise
FifthSurprise / gist:9954300
Created April 3, 2014 13:27
Javascript Autocomplete sample
function updateSearchValues() {
function collect(arr, value) {
var results = [];
for (var i = 0; i < arr.length; i++) {
results.push(arr[i][value]);
}
return results;
};
var booksearch = $("#booksearch");
//Only request if 3 or more characters entered into search
~~Flatiron Students
~~Question:
Guess the student.
![Justin Belmont](http://students.flatironschool.com/img/students/justinbelmont_profile.jpg)
~Answer:
Justin Belmont
~~Question:
Guess the student.
![Morgan Evans](http://students.flatironschool.com/img/students/M.Evans.school.square.jpg)
~~Pokemon
~~Question:
Bulbasaur
~Answer:
![Bulbasaur](http://Bulbasaur.jpg.to)
~~Question:
Ivysaur
~~Hipster Ipsum
~~Question:
Street art fap roof party Intelligentsia mustache keytar church-key Shoreditch Marfa
~Answer:
Meggings shabby chic pug, chia Etsy street art Godard High Life direct trade
~~Question:
Put a bird on it banjo DIY, trust fund viral yr meh ennui Marfa
~Answer:
Bicycle rights chambray before they sold out High Life Banksy
~~Question:
~~Big O
~~Question:
Depth First Search (DFS)
~Answer:
Graph of |V| vertices and |E| edges
Average Time Complexity: -
Worst Time Complexity: (Good) O(|E| + |V|)
Worst Space Complexity: O(|V|)