Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
exec scala -savecompiled "$0" "$@"
!#
// Get the shell scripting enrichments
import scala.sys.process._
val alwaysKeep = Set("develop", "master")
// Now delete any merged branches"
val branches: String = "git branch".!!
library(maps)
library(geosphere)
library(plyr)
library(ggplot2)
library(sp)
airports <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/airports.csv", as.is=TRUE, header=TRUE)
flights <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/PEK-openflights-export-2012-03-19.csv", as.is=TRUE, header=TRUE)
# aggregate nunber of flights
library(ggplot)
decay <- function (x, lambda = 5) {
return((100 * exp((-1 * lambda) * x)))
}
xs <- seq(from = 1, to = 10, by = 0.001)
ys <- sapply(xs, decay, lambda = 0.4)
@rweald
rweald / rspec-syntax-cheat-sheet.rb
Created August 31, 2012 18:45 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@rweald
rweald / gist:3151173
Created July 20, 2012 14:59 — forked from igrigorik/gist:3148848
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > brew install ffprobe
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
@rweald
rweald / build.sbt
Created March 24, 2012 18:22 — forked from mumoshu/build.sbt
DES and AES encryption in Scala
name := "DES and AES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"