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
= form_for @nurse, do |f| | |
- @nurse.errors.full_messages.each do |msg| | |
%p= msg | |
%fieldset | |
%p | |
= f.label "Name: ",:class => 'required' | |
%br/ | |
= f.text_field :name, :id => 'name', :class => 'half' | |
%p | |
= f.label "Telephone Number: ",:class => 'required' |
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 | |
if ( $_SERVER['HTTP_HOST'] == 'hourtown.com' ) { | |
header('location: http://www.hourtown.com' . $_SERVER['REQUEST_URI']); | |
exit; | |
} | |
if (in_array($_SERVER['REMOTE_ADDR'], array('72.32.197.151'))){ | |
sleep(rand(10,50)); | |
} |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'mysql2', '< 0.3' | |
gem 'haml-rails' | |
gem 'devise' | |
group :assets do | |
gem 'sass-rails', " ~> 3.1.0" | |
gem 'coffee-rails', "~> 3.1.0" |
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 'rvm/capistrano' | |
require 'bundler/capistrano' | |
set :application, "staging.xxxx.com" | |
#set :repository, "." | |
set :scm, :git | |
set :repository, "." | |
set :deploy_via, :copy | |
# set :port, 16888 |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" | |
alias rake="noglob rake" | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. |
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
Models | |
class User < ActiveRecord::Base | |
has_many :dnshospitals | |
has_many :hospitals, :through => :dnshospitals | |
end | |
class Hospital < ActiveRecord::Base | |
has_many :dnshospitals | |
has_many :users, :through => :dnshospitals |
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 Availability < ActiveRecord::Base | |
attr_accessible :name, :hospital_tokens, :start_at, :end_at, :shift | |
has_many :appointments | |
has_many :hospitals, :through => :appointments | |
belongs_to :user | |
has_event_calendar | |
attr_reader :hospital_tokens | |
scope :by_hospital, lambda { |hospital| selected_hospital(hospital) } | |
scope :by_date, lambda { |date| where("start_at >= ? AND start_at <= ?", date, date) } |
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 | |
require_once('When.php'); | |
$_POST['weekly'] = true; | |
//array('MO','TU','WE','TH','FR','SA','SU') | |
$repeat_days = $_POST['selected_days']; | |
$repeat_type = isset($_POST['weekly']) ?: $_POST['monthly']; | |
//e.g 01/01/2013 | |
$end = $_POST['end_date']; |
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
$week_no = array(2,3,4); | |
$days = array('TU', 'WE', 'TH'); | |
foreach ($week_no as $n) { | |
foreach ($days as $d) { | |
$out[] = $n . $d; | |
} | |
} | |
var_dump($out); // array('2TU', '2WE', '2TH','3TU', '3WE', '3TH, '4TU', '4WE', '4TH) |
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
--- | |
Name: app | |
After: framework/routes#coreroutes | |
--- | |
Director: | |
rules: | |
'dev': 'DevelopmentAdmin' | |
'sitemap.xml': 'GoogleSitemap' | |
'$Action' : 'BaseController' |
OlderNewer