Technology Stack for Rails
Core
- Rails 3.0.1
- Ruby 1.9.2 (use RVM for mgmt.)
Development
- Bundler – manage gem dependencies
require "mini_magick" | |
image = MiniMagick::Image.from_file("c:\\test.jpg") | |
image.resize "100x100" | |
image.write("c:\\output.jpg") |
require 'RMagick' | |
include magick | |
# Demonstrate the GradientFill class | |
Rows = 100 | |
Cols = 300 | |
Start = "#900" | |
End = "#000" |
.irbrc for Win32 | |
Create a file called anything you like (e.g. “_irbrc” or “irb.rc”) and place it anywhere you like (say C:\Documents and Settings\), and set that full path to the ENV variable IRBRC, e.g. C:\Documents and Settings\\_irbrc | |
## Libraries | |
require 'rubygems' | |
require 'irb/completion' | |
require 'map_by_method' | |
require 'what_methods' | |
require 'pp' |
Technology Stack for Rails
Core
Development
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
#gem 'mysql2' | |
gem "sqlite3-ruby" |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
#gem 'mysql2' | |
gem "sqlite3-ruby" |
require 'hmac-sha1' | |
require 'digest/sha1' | |
require 'base64' | |
token="-Sat, 14 Nov 2009 09:47:53 GMT-GET-/video.xml-" | |
private_key="whatever" | |
salt=Digest::SHA1.hexdigest(token)[0..19] | |
passkey=Base64.encode64(HMAC::SHA1.digest(private_key, salt)).strip |
Coffeescript: | |
masterTableView = new TableView | |
id:'masterView' | |
data:tableData | |
layout:'vertical' | |
style: Titanium.UI.iPhone.TableViewStyle.GROUPED | |
editable:true <========= | |
complies to JS: |
domDocument = Titanium.XML.parseString(this.responseText) | |
domNodeList = domDocument.getElementsByTagName("Contents") | |
objectsList = []; | |
for (var i = 0; i < domNodeList.length; i++) | |
{ | |
keyName = item.getElementsByTagName('Key').item(0).textContent; | |
size = objects[i].getElementsByTagName('Size').item(0).textContent; | |
objectsList[i] = { | |
key: keyName, |
@import compass/css3 | |
$color-light: #fff | |
$color-grey: #ddd | |
$color-dark: #000 | |
//-------------------------------------------------------------------------------- | |
// I started out like this, getting all | |
// carried away with how awesome Sass |