Skip to content

Instantly share code, notes, and snippets.

View vanmichael's full-sized avatar

van nguyen vanmichael

  • OpenTable
  • San Francisco
View GitHub Profile
@vanmichael
vanmichael / .vimrc
Created June 13, 2017 15:50
.vimrc
set shortmess=a
set t_Co=256
syntax on
set background=dark
set nowrap
set showmatch
set showcmd
set number
@vanmichael
vanmichael / maximum.js
Created March 1, 2014 19:37
Whats better javascript OOP notation?
var Maximum = function(array) {
this.array = array;
this.findMax = function (){
var maxValue = 0;
this.array.forEach(function(n) {
if (maxValue < n)
{
maxValue = n;
}
require 'pry-debugger'
class Anagram
attr_reader :word
def initialize(word)
@word = word
end
def letters
class Circle
attr_reader :radius
def initialize(radius)
@radius = radius
end
def diameter
@radius * 2
require 'pry'
class WordTracker
attr_reader :words
def initialize(words)
@words = words
@frequency = Hash.new(0)
end
@vanmichael
vanmichael / 1.txt
Last active December 30, 2015 19:39
title | rating
------------------------------------------------+--------
Mulan II | 0
Beauty and the Beast - The Enchanted Christmas | 0
Police Academy 5 - Assignment Miami Beach | 0
InSight | 0
Police Academy 4 - Citizens on Patrol | 0
Troll 2 | 0
That Was Then... This Is Now | 0
Fred: The Movie | 0

Mulan II | 0 Beauty and the Beast - The Enchanted Christmas | 0 Police Academy 5 - Assignment Miami Beach | 0 InSight | 0 Police Academy 4 - Citizens on Patrol | 0 Troll 2 | 0 That Was Then... This Is Now | 0 Fred: The Movie | 0 S. Darko: A Donnie Darko Tale | 0 The Fox and the Hound 2 | 0

require 'pry'
class PigLatin
def initialize(phrase)
@phrase = phrase.downcase
end
#provide the pig latin translation
def translate
require 'pry'
class PigLatinTranslation
def initialize(phrase)
@phrase = phrase.downcase
end
#provide the pig latin translation
def translate
require 'pry'
require 'csv'
class EmployeeReader
attr_reader :employees
def initialize(file_name)
get_employees(file_name)
end