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
sealed case class Person(name: String, age: Int)
val p = Person("Steven", 38)
println(p)
val p2 = p.copy(age = 39)
println(p2)
#!/usr/bin/ruby
seconds = [
2 * 60 + 58.65,
3 * 60 + 19.55,
3 * 60 + 13.48 ,
3 * 60 + 3.89,
3 * 60 + 18.69,
2 * 60 + 59.03,
2 * 60 + 58.42,
$ sudo port install id3lib
---> Computing dependencies for id3lib
---> Fetching id3lib
---> Attempting to fetch id3lib-3.8.3.tar.gz from http://mirror.aarnet.edu.au/pub/FreeBSD/ports/distfiles/
---> Verifying checksum(s) for id3lib
---> Extracting id3lib
---> Applying patches to id3lib
---> Configuring id3lib
---> Building id3lib
---> Staging id3lib into destroot
#!/usr/bin/ruby
require 'rubygems'
require 'id3lib'
def usage()
STDERR.puts "Usage: id3dump <mp3-file>"
exit 1
end
#!/bin/bash
find . -type d -mindepth 1 -maxdepth 1 -print0 | xargs -0 du -ms | sort -rn | cut -f2 | while read dir; do
du -hs "$dir"
done
#!/usr/bin/ruby
require 'rubygems'
require 'id3lib'
def usage()
STDERR.puts "Usage: id3dump <mp3-file>"
exit 1
end
#!/usr/bin/ruby
require 'rubygems'
require 'id3lib'
def usage()
scriptName = File.basename($0)
STDERR.puts "Usage: #{scriptName} <mp3-file>"
exit 1
end
$ gist Foo.scala
http://gist.github.com/365257
$ cat /etc/launchd.conf
setenv JAVA_HOME /Library/Java/Home
setenv SCALA_HOME /Users/steven/local/scala
setenv M2_HOME /Users/steven/local/maven
setenv MAVEN_OPTS -Xmx256m
$ echo launchd is the root of all user processes on the Mac... but that was the old way. Now with the new:
echo launchd is the root of all user processes on the Mac... but that was the old way. Now with the new:
$ cat ~/bin/Sync<tab>
$ cat .ensime.m4
(
:server-root "ENSIME_HOME()"
:server-cmd "bin/server.sh"
:server-host "localhost"
:server-env ()
:project-package "com.guvera.consumer"
:source ("src")
:exclude-source ()