This file contains hidden or 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
# Exclude this URL from redirect | |
RewriteCond %{REQUEST_URI} !^/foo\.html$ [NC] | |
# Redirect everything else here | |
RewriteRule .* http://domain.com/$1 [NC,L] |
This file contains hidden or 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
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) { |
This file contains hidden or 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 'rubygems' | |
require 'octopi' | |
require 'choice' | |
include Octopi | |
Choice.options do | |
header '' |
This file contains hidden or 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
git init | |
git status | |
touch log/.gitignore tmp/.gitignore vendor/.gitignore | |
git add . | |
git commit -a | |
.gitignore | |
========== | |
.DS_Store | |
config/database.yml |
This file contains hidden or 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 | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title passenger status | |
graph_vlabel count | |
sessions.label sessions | |
max.label max processes |
This file contains hidden or 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
# From: http://afreshcup.com/home/2009/9/2/migrating-to-snow-leopard-for-rails-development-a-definitive.html | |
sudo gem install rvm | |
rvm-install | |
rvm install 1.8.6 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.8.7 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.9.1 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm install 1.9.2 -C --enable-shared,--with-readline-dir=/usr/local | |
rvm 1.8.7 --default |
This file contains hidden or 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
1) Make sure .ssh directory exists on remote server | |
2) Generate SSH key using ssh-keygen -t rsa | |
3) Copy public key onto remote server and append to ~/.ssh/authorised_keys2 | |
4) Test password-less SSH onto remote server, might need to edit ~/.ssh/config | |
Host shortname | |
HostName ipaddr | |
Port blah (if port not 22) | |
User blah (if user not the same as local user) |
This file contains hidden or 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
.group:after { | |
content: "."; | |
display: block; | |
height: 0; | |
clear: both; | |
visibility: hidden; | |
overflow: hidden; | |
} | |
* html .group { |
This file contains hidden or 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
# Requires the following gems: prawn, barby and rqrcode | |
require "prawn" | |
require "prawn/measurement_extensions" | |
require "barby" | |
require "barby/barcode/code_128" | |
require "barby/outputter/prawn_outputter" | |
barcode = Barby::Code128.new('12345','A') | |
badge = Prawn::Document.new(:page_size => "A5", :page_layout => :landscape, :margin => 0) do |pdf| |
This file contains hidden or 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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
OlderNewer