Skip to content

Instantly share code, notes, and snippets.

View bookest's full-sized avatar

Christopher Grim bookest

View GitHub Profile
/**
* Port of the FizzBuzz solution described in
* [http://themonadreader.files.wordpress.com/2014/04/fizzbuzz.pdf
* FizzBuzz in Haskell by Embedding a Domain-Specific Language] to
* scala.
*/
object FizzBuzz {
def fizzbuzz(n:Int):String = {
def test(d:Int, s:String)(x:String => String) =
if (n % d == 0) Function.const(s ++ x(""))_
@bookest
bookest / gist:1440017
Created December 6, 2011 21:08
Disable Cmd-Q in Terminal.app
defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add "Quit Terminal" nil
#!/usr/bin/env ruby
#
# Update JIRA with git commit messages
#
# == Usage ==
#
# To update a JIRA issue, prepend the first line of your git commit message
# with the issue key and a colon:
#
# $ git commit -m "GIT-1: Updates something"
# A bash function to display a growl notification using iTerm's magic
# escape sequence[1]. This version will work under screen.
#
# [1] <http://damonparker.org/blog/2006/11/13/iterm-and-growl/>
growl() {
local msg="\\e]9;\n\n${*}\\007"
case $TERM in
screen*)
echo -ne '\eP'${msg}'\e\\' ;;