http://developer.apple.com/tools/developonrailsleopard.html
sudo gem update --system
sudo gem install rails
sudo gem update rake
sudo gem update sqlite3-ruby
#!/usr/bin/env ruby | |
# Texmate command: open markdown links | |
# <http://macromates.com/> | |
# [My favorite editor](http://macromates.com/) | |
idx = ENV['TM_LINE_INDEX'].to_i | |
line = ENV['TM_CURRENT_LINE'] | |
alt_tokens = line.include?('<') && line.include?('>') | |
b_token = alt_tokens ? '<' : '(' | |
e_token = alt_tokens ? '>' : ')' |
/* Cross browser transparency */ | |
.transparent_class { | |
filter:alpha(opacity=50); | |
-moz-opacity:0.5; | |
-khtml-opacity: 0.5; | |
opacity: 0.5; | |
} |
<?php | |
// LIMONADE SESSION FEATURES EXAMPLES | |
require_once 'lib/limonade.php'; | |
function configure() | |
{ | |
// by default, session is enable. It automaticaly start a session with LIM_SESSION_NAME as name | |
option('session', false); // disable | |
option('session', true); // enable |
<?php | |
// LIMONADE FLASH FEATURES EXAMPLES | |
require_once 'lib/limonade.php'; | |
function configure() | |
{ | |
option('env', ENV_DEVELOPMENT); | |
} | |
function before() |
<?php | |
# LIMONADE URL REWRITING EXAMPLE | |
# In your .htaccess in your app folder | |
# <IfModule mod_rewrite.c> | |
# Options +FollowSymlinks | |
# Options +Indexes | |
# RewriteEngine on |
echo `date "+%d %B %Y"` | awk '{ print substr(" ",1,(21-length($0))/2) $0; }'; cal | awk '{ getline; print " Mo Tu We Th Fr Sa Su"; getline; if (substr($0,1,2) == " 1") print " 1 "; do { prevline=$0; if (getline == 0) exit; print " "substr(prevline,4,17) " " substr($0,1,2) " "; } while (1) }' | awk -v cday=`date "+%d"` '{ fill=(int(cday)>9?"":" "); a=$0; sub(" "fill int(cday)" ","*"fill int(cday)"*",a); print a }' |
require 'find' | |
require 'fileutils' | |
dir = '/your_directory' | |
Find.find(dir) do |path| | |
if FileTest.directory?(path) && File.basename(path) == '.svn' | |
p 'rm directory:' + path | |
FileUtils.remove_dir(path) | |
else |
find your_project -type d -name .svn | xargs rm -rf |
http://developer.apple.com/tools/developonrailsleopard.html
sudo gem update --system
sudo gem install rails
sudo gem update rake
sudo gem update sqlite3-ruby
# Paperclip attachment, with sorting and special convert options | |
class PageAsset < ActiveRecord::Base | |
acts_as_list :scope => :page | |
has_attached_file :asset, | |
:styles => { | |
:small => "110x82#", | |
:thumb => "150x90#", | |
:large => "460x345>", | |
:original => "1600x1200>" | |
}, |