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
| <?php | |
| /* | |
| Template Name: Archives | |
| */ | |
| ?> | |
| <?php get_header(); ?> | |
| <div id="content"> | |
| <?php |
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
| resources :clients do | |
| collection do | |
| post "calls" # Auto maps to clients#calls | |
| end | |
| end |
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
| #$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
| require 'bundler/capistrano' | |
| set :stages, %w(production staging) | |
| set :keep_releases, 3 | |
| set :default_stage, "staging" | |
| require 'capistrano/ext/multistage' | |
| set :whenever_command, "bundle exec whenever" | |
| set :whenever_environment, defer { stage } |
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
| articles = [ | |
| { :id => '1', :type => 'article', :title => 'one', :tags => ['ruby'] }, | |
| { :id => '2', :type => 'article', :title => 'two', :tags => ['ruby', 'python'] }, | |
| { :id => '3', :type => 'article', :title => 'three', :tags => ['java'] }, | |
| { :id => '4', :type => 'article', :title => 'four', :tags => ['ruby', 'php'] } | |
| ] | |
| Tire.index 'articles' do | |
| import articles | |
| end |
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 ApplicationController < ActionController::Base | |
| before_filter do | |
| if request.ssl? && Rails.env.production? && request.domain == "mobicontact.net" | |
| redirect_to :protocol => 'http://', :status => :moved_permanently | |
| end | |
| end | |
| end |
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
| def create | |
| medic = Medic.find(params[:paging][:incharge_paging_id]) | |
| PagingsMailer.paging(medic, message).deliver | |
| end |
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 Paging < ActiveRecord::Base | |
| #Associations | |
| def send_mail | |
| if medic_id? | |
| PagingMailer.blah(medic, message).deliver | |
| elsif unit_id? | |
| PagingMailer.blah(unit.in_charge, message).deliver | |
| PagingMailer.blah(unit.attendant, message).deliver | |
| end |
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
| call.unit.status.try(:unit_status) => Fails | |
| call => Call(1) | |
| call.unit => Call(1).unit => nil | |
| call.unit.status => Call(1).nil.status => ERROR |
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
| def word_to_number(word) | |
| onesPlace = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] | |
| tensPlace = [nil, 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'] | |
| onesPlace.index(word) || tensPlace.index(word) * 10 | |
| end | |
| puts word_to_number('one') | |
| puts word_to_number('two') | |
| puts word_to_number('three') |
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
| chris at tyndall using ruby-1.9.3-p194 in ~/code | |
| ○ brew install macvim | |
| MacVim compiles against whatever Ruby it finds in your path, and has | |
| problems working with Ruby 1.9. We've detected Ruby 1.9 in your path, | |
| so this compile may fail. | |
| ==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64 | |
| Already downloaded: /Library/Caches/Homebrew/macvim-7.3-64.tgz | |
| ==> ./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-tclinterp | |
| ==> make getenvy | |
| ==> make |