Skip to content

Instantly share code, notes, and snippets.

RewriteEngine on
RewriteRule (.*) index.php [L]
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
[al3x@jaya FilePile:master|MERGING]$ git st
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: tags/5_1_RELEASE/lib/filepile/formatter.rb -> lib/filepile/formatter.rb
# deleted: tags/5_0_1_RC1/RAILS_README
# deleted: tags/5_0_1_RC1/README
# deleted: tags/5_0_1_RC1/Rakefile
# deleted: tags/5_0_1_RC1/app/controllers/account_controller.rb
[user]
name = Alex Payne
email = al3x@al3x.net
autosetupmerge = auto
[alias]
co = checkout
ci = commit -a
st = status -a
br = branch
def forLineInFile(file: String)(f: String => Unit) {
val src = Source.fromFile(file)
src.getLines.foreach(f)
}
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)
#!/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"
@al3x
al3x / newpost.rb
Created April 22, 2009 23:50
Handy new post script for Jekyll blogs or similar
#!/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"
@al3x
al3x / bundleup.rb
Created April 15, 2009 18:31
Brute force update of TextMate bundles, be they from Git or Subversion
#!/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"
@al3x
al3x / gist:78799
Created March 13, 2009 22:20
A part of UserSpec
"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
}