Skip to content

Instantly share code, notes, and snippets.

View steshaw's full-sized avatar
👨‍💻
Loves programming languages

Steven Shaw steshaw

👨‍💻
Loves programming languages
View GitHub Profile
(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 ()
#!/usr/bin/ruby
require 'rubygems'
require 'id3lib'
def usage()
scriptName = File.basename($0)
STDERR.puts "Usage: #{scriptName} <mp3-file>"
exit 1
end
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
git add $(git status | grep modified | awk '{print $3}')
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
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")
public class Checked {
static class CheckedException extends Exception {}
public int foo() throws CheckedException {
return 0;
};
}
data CoolBool = CoolBool { getBool :: Bool } deriving (Eq, Show, Read)
alwaysHello :: CoolBool -> String
alwaysHello (CoolBool _) = "hello"
--alwaysHello _ = "hello"
(* 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
;;
;; 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.