Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am daltonhuynh on github.
  • I am dalton (https://keybase.io/dalton) on keybase.
  • I have a public key whose fingerprint is C7A0 43F7 9873 29F2 7B2F D1C4 85D4 D513 907F AC33

To claim this, I am signing this object:

Verifying that +dalton is my Bitcoin username. You can send me #bitcoin here: https://onename.io/dalton

Keybase proof

I hereby claim:

  • I am huydalton on github.
  • I am dalton (https://keybase.io/dalton) on keybase.
  • I have a public key whose fingerprint is C7A0 43F7 9873 29F2 7B2F D1C4 85D4 D513 907F AC33

To claim this, I am signing this object:

@daltonhuynh
daltonhuynh / higher_order.scala
Created May 22, 2011 03:08
pattern matching in scala (map/fold)
// simple map and fold left/right implementations
// in scala using pattern matching for List[Int]
def map(list:List[Int], f:(Int) => Int):List[Int] = {
list match {
case Nil => Nil
case head::tail => f(head)::map(tail, f)
}
}
@daltonhuynh
daltonhuynh / level_1.rb
Created May 21, 2011 21:08
Greplin Challenge Problems
class String
def palindrome?
front = 0
back = self.length - 1
while front < back do
return false if self[front] != self[back]
front += 1
back -= 1