This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00000000-0000-0000-0000-000000000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows.sortBy(r => (r.lastName, r.firstName)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3 cp s3://yourbucket/yourkey.gz - | gzcat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pv < yourfile.csv | psql -c "copy yourtable from STDIN;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install gist; gist -f filename -Po |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit def `joda datetime ordering`: Ordering[DateTime] = Ordering.fromLessThan(_ isBefore _) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo defaults write com.apple.LaunchServices LSQuarantine -bool NO | |
sudo defaults write com.apple.dock no-bouncing -bool TRUE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Conway's Game of Life, using Processing, written in Scala | |
// see: http://en.wikipedia.org/wiki/Conway's_Game_of_Life | |
// see: http://processing.org/ | |
// see: http://www.scala-lang.org/ | |
// run using processing-scala-sbt: | |
// https://github.com/landon9720/processing-scala-sbt | |
// this code is by Landon Kuhn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// borrowed from http://louisbotterill.blogspot.com/2009/03/prime-factorization-comparison-between.html | |
def factors(n:Int):List[Int] = { | |
def divides(d:Int, n:Int) = (n % d) == 0 | |
def ld(n:Int):Int = ldf(2, n) | |
def ldf(k:Int, n:Int):Int = { | |
if (divides(k, n)) k | |
else if ((k*k) > n) n | |
else ldf((k+1), n) | |
} | |
n match { |