Skip to content

Instantly share code, notes, and snippets.

git init
git status
touch log/.gitignore tmp/.gitignore vendor/.gitignore
git add .
git commit -a
.gitignore
==========
.DS_Store
config/database.yml
@leeky
leeky / ghkey.rb
Created May 12, 2009 10:07 — forked from fcoury/ghkey.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'octopi'
require 'choice'
include Octopi
Choice.options do
header ''
@leeky
leeky / gist:61922
Created February 11, 2009 08:47 — forked from rails/gist:58761
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
# Exclude this URL from redirect
RewriteCond %{REQUEST_URI} !^/foo\.html$ [NC]
# Redirect everything else here
RewriteRule .* http://domain.com/$1 [NC,L]