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
# == Schema Information | |
# | |
# Table name: experiences | |
# | |
# id :integer(4) not null, primary key | |
# doctor_id :integer(4) | |
# place_of_practice :string(255) | |
# year_start :integer(4) | |
# year_end :integer(4) | |
# created_at :datetime |
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
# gzip html, css and js | |
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript application/javascript | |
# far future expires headers | |
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
ExpiresDefault "access plus 10 years" | |
</FilesMatch> |
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
set :application, "My supper app" | |
set :repository, "svn://yoursvnhost/svn/yourproject/" | |
set :scm, :subversion | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
role :web, "http://mywebserver.com" # Your HTTP server, Apache/etc | |
role :app, "http://myappserver.com" # This may be the same as your `Web` server | |
role :db, "http://mymaindbserver.com", :primary => true # This is where Rails migrations will run | |
role :db, "http://myslaveserver.com" |
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
module Matz | |
def self.included(*) | |
puts <<-MATZ | |
Simplicity is NOT a Goal | |
------------------------ | |
Things too simple are difficult | |
Things too complex are difficult |
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
>> o.total_price == 13.78 | |
=> false | |
>> o.total_price | |
=> 13.78 | |
>> o.total_price.class | |
=> Float |
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
class HomeController < ApplicationController | |
def index | |
key = '8J0aBBq6zOP2dqtARKzAw' | |
secret = 'RIKTpVosvsPXdyUlgZO0mnkvHnn42P5IugxRXHEsY' | |
@consumer = OAuth::Consumer.new(key,secret,{ :site=>"http://twitter.com", | |
:authorize_url => "http://twitter.com/oauth/authenticate" }) | |
@request_token = @consumer.get_request_token(:oauth_callback => 'http://rociiu.com/home/twitter_callback') | |
session[:request_token] = @request_token | |
redirect_to @request_token.authorize_url |
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
class UserSessionsController < InheritedResources::Base | |
actions :new, :create, :destroy | |
before_filter :require_no_user, :only => [:new, :create] | |
before_filter :require_user, :only => :destroy | |
# create! do |success, failure| | |
# @user_session = UserSession.new(params[:user_session]) | |
# @user_session.save do |result| | |
# if result | |
# flash[:notice] = "Login successful!" |
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
class UserSessionsController < InheritedResources::Base | |
actions :new, :create, :destroy | |
before_filter :require_no_user, :only => [:new, :create] | |
before_filter :require_user, :only => :destroy | |
# create! do |success, failure| | |
# @user_session = UserSession.new(params[:user_session]) | |
# @user_session.save do |result| | |
# if result | |
# flash[:notice] = "Login successful!" |
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 'ftools' | |
require 'fileutils' | |
require 'rubygems' | |
require 'RMagick' | |
include Magick | |
require 'open3' | |
def merge( files = [] ) |