This file contains 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
function rbdiff { | |
local branch | |
branch=$(git name-rev --name-only head) | |
git diff master..HEAD > "~/Desktop/${branch}.diff" | |
} |
This file contains 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
[al3x@rawls ~]$ sudo port sync; sudo port upgrade outdated | |
Password: | |
---> Building texlive_base | |
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_tex_texlive_base/work/texlive_base-2007" && make all " returned error 2 | |
Command output: make[2]: Nothing to be done for `all'. | |
make[2]: Nothing to be done for `all'. | |
make all-recursive | |
Making all in data | |
make[4]: Nothing to be done for `all'. | |
Making all in src |
This file contains 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
class Primary | |
def hello | |
puts "hello from Primary" | |
end | |
def call_hello | |
hello | |
end | |
end | |
This file contains 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
[al3x@rawls spde:master]$ buildr run --trace | |
2009-03-04 13:45:41.456 ruby[3687:10b] RBCocoaInstallRubyThreadSchedulerHooks: couldn't find autoreleasePool ivar | |
(in /Users/al3x/src/third_party/scala/spde, development) | |
** Invoke buildr:initialize (first_time) | |
** Execute buildr:initialize | |
** Invoke spde (first_time) | |
** Execute spde | |
** Invoke /Users/al3x/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar (first_time, not_needed) | |
** Invoke /Users/al3x/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar (first_time, not_needed) | |
** Invoke /Users/al3x/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-trax-1.7.1.jar (first_time, not_needed) |
This file contains 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
"showing a nonexistant user returns 404" in { | |
withFormats(List("xml", "json")) { format => | |
val response = User.show("jack", "asonetibaosneitb", format) | |
response mustNot beNull | |
response.code mustEqual 404 | |
response | |
} mustNot beEmpty | |
} |
This file contains 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/env ruby | |
require 'fileutils' | |
ENV['LC_ALL'] = nil | |
ENV['LC_CTYPE'] = 'en_US.UTF-8' | |
DEBUG = false | |
bundle_dir = "#{ENV['HOME']}/Library/Application\ Support/TextMate/Bundles" |
This file contains 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/env ruby | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
date_prefix = Time.now.strftime("%Y-%m-%d") | |
postname = ARGV[0].strip.downcase.gsub(/ /, '-') | |
post = "/Users/al3x/src/al3x.github.com/_posts/#{date_prefix}-#{postname}.textile" |
This file contains 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 | |
# assumes the user has configured a TextMate project that | |
# points to the directory full of journal entry files | |
require 'date' | |
require 'fileutils' | |
date = Date.today | |
entry = "/Volumes/Personal/journal/#{date.to_s}.textile" |
This file contains 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
import java.security.MessageDigest | |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
import scala.util.Random | |
class DigestComparisonActor extends Actor { | |
val md5 = MessageDigest.getInstance("MD5") | |
val rand = new scala.util.Random() | |
var byteArray = new Array[Byte](32) |
This file contains 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
def forLineInFile(file: String)(f: String => Unit) { | |
val src = Source.fromFile(file) | |
src.getLines.foreach(f) | |
} |