This file contains 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
$(document).ready(function(){ | |
$('form.play-card-button').live("ajax:success", function(event, data){ | |
$("#game-page").html(data); | |
autoplay(); | |
}); | |
}); | |
function autoplay() | |
{ | |
$.ajax({ |
This file contains 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 PasswordReset < ActiveRecord::Base | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
attr_accessor :existing_user, :user, :identifier, :password, :password_confirmation | |
validates_presence_of :identifier, :unless => :persisted? | |
validates_presence_of :password, :if => :persisted? | |
validates_confirmation_of :password, :if => :password? | |
validate :user_exists, :unless => :persisted? |
This file contains 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
setPublisherProperties: function(){ | |
var properties | |
var widthHeight = VT.getWidthHeight(Object.keys(VT.subscribers).length+1); | |
properties.width = widthHeight.width; | |
properties.height = widthHeight.height; | |
properties.microphoneGain = 0; | |
return properties; | |
}, | |
setPublisherProperties: function(){ |
This file contains 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
b = create_user("brian@example.com") | |
a = create_user("andy@example.com") | |
def create_user(email, password = "secret") | |
User.create({:email => email, :password => password, :password_confirmation => password}) | |
end | |
rake aborted! |
This file contains 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 find_suggestions_for(restaurant) | |
past_orders = [] | |
orders.each {|o| past_orders << o if o.restaurant == restaurant } | |
past_orders | |
end | |
def find_suggestions_for(restaurant) | |
orders.inject([]) do |result, order| | |
result << order if order.restaurant == restaurant |
This file contains 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
if !current_user.nil? | |
@applicant ||= current_user.applicant | |
@applicant ||= Applicant.new if @applicant.nil? | |
end | |
# Refactor to | |
if current_user.present? | |
@applicant ||= current_user.applicant || Applicant.new | |
end |
This file contains 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
######## git_completion.bash ######## (from Chris J. file suggestion) | |
complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ | |
|| complete -o default -o nospace -F _git git | |
## Just added this line below, it works | |
complete -o default -o nospace -F _git_checkout gch | |
######## /usr/local/etc/bash_completion.d/git_completion.bash ######## (from brew install bash-completion) |
This file contains 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
######## git_completion.bash ######## | |
complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ | |
|| complete -o default -o nospace -F _git git | |
## Just add this line | |
complete -o bashdefault -o default -o nospace -F _git_checkout gch 2>/dev/null \ | |
|| complete -o default -o nospace -F _git_checkout gch |
This file contains 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 has_a_thing_at(time) | |
any_events_at?(time) || any_interview_slots_at?(time) || any_free_slots_at?(time) | |
end | |
def any_events_at?(time) | |
events.where("start_time <= ? and end_time > ?", time, time).any? | |
end | |
def any_interview_slots_at?(time) | |
interview_slots.where("start_time <= ? and end_time > ?", time, time).any? |
This file contains 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
group :test, :development do | |
gem 'capybara' | |
gem 'capybara-webkit' | |
gem 'database_cleaner' | |
end |
OlderNewer