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
| (defun read-lines (file-path) | |
| (with-temp-buffer | |
| (insert-file-contents file-path) | |
| (split-string (buffer-string) "\n" t))) | |
| ( | |
| :server-root (getenv "ENSIME_HOME") | |
| :server-cmd "bin/server.sh" | |
| :server-host "localhost" | |
| :server-env () |
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
| #!/usr/bin/ruby | |
| require 'rubygems' | |
| require 'id3lib' | |
| def usage() | |
| scriptName = File.basename($0) | |
| STDERR.puts "Usage: #{scriptName} <mp3-file>" | |
| exit 1 | |
| end |
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
| git log file-of-interest | grep ^commit | cut -d' ' -f2 | while read commit; do echo "=== commit $commit ==="; if git show $commit | grep string-of-interest; then break; fi; done |
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
| git add $(git status | grep modified | awk '{print $3}') |
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
| scala> case class Person(name: String, age: Int) | |
| defined class Person | |
| scala> val p1 = Person("Steve", 39) | |
| p1: Person = Person(Steve,39) | |
| scala> val p2 = Person("Steve", 39) | |
| p2: Person = Person(Steve,39) | |
| scala> p1 == p2 |
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
| scala> new Foo(1, "one") | |
| res0: Foo = Foo(1,one) | |
| scala> new Foo(1, "one").hashCode | |
| res1: Int = 113585 | |
| scala> new Foo(1, "one").hashCode | |
| res2: Int = 113585 | |
| scala> new Foo(1, "one") == new Foo(1, "one") |
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
| public class Checked { | |
| static class CheckedException extends Exception {} | |
| public int foo() throws CheckedException { | |
| return 0; | |
| }; | |
| } |
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
| data CoolBool = CoolBool { getBool :: Bool } deriving (Eq, Show, Read) | |
| alwaysHello :: CoolBool -> String | |
| alwaysHello (CoolBool _) = "hello" | |
| --alwaysHello _ = "hello" |
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
| (* A simple pattern matching example from http://www.c2.com/cgi/wiki?PatternMatching *) | |
| (* | |
| * Define type `expr' to have two constructors: | |
| * Constant(anInteger) represents a constant | |
| * Sum(anExpr, anotherExpr) represents the sum of two expressions. | |
| *) | |
| datatype expr = | |
| Constant of int |
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
| ;; | |
| ;; MobileOrg on iPad using Dropbox | |
| ;; | |
| ;; Settings basically copied from the screen cast, they differ | |
| ;; on the `org-mobile-inbox-for-pull` var wrt. the instructions | |
| ;; on the website. | |
| ;; - If MobileOrg is already linked to Dropbox. Unlink and delete | |
| ;; the ~/Dropbox/MobileOrg folder. |