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
#!/usr/bin/env python | |
import sys | |
import random | |
from ctypes import * | |
from Phidgets.Devices.InterfaceKit import InterfaceKit | |
from Phidgets.PhidgetException import PhidgetErrorCodes, PhidgetException | |
try: | |
kit = InterfaceKit() | |
kit.openPhidget() |
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
Started POST "/avatars" for 127.0.0.1 at 2012-10-29 11:35:49 -0400 | |
Processing by AvatarsController#create as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"VpFNQxYczGC3d/m+HlC8ski3vPCIwJu8xbmb70HpJ7I=", "avatar"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f8b2fae2ec0 @original_filename="vigeclones.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"avatar[image]\"; filename=\"vigeclones.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/var/folders/j3/zdf8571x7cx8q0mwm2c_r57r0000gn/T/RackMultipart20121029-23346-bh66db>>}, "commit"=>"Add Image"} | |
Command :: identify -format %wx%h '/var/folders/j3/zdf8571x7cx8q0mwm2c_r57r0000gn/T/vigeclones20121029-23346-1qx7yn.jpg[0]' | |
Command :: identify -format %m '/var/folders/j3/zdf8571x7cx8q0mwm2c_r57r0000gn/T/vigeclones20121029-23346-1qx7yn.jpg[0]' | |
Command :: identify -format %m '/var/folders/j3/zdf8571x7cx8q0mwm2c_r57r0000gn/T/vigeclones20121029-23346-1qx7yn.jpg[0]' | |
Command :: convert '/var/folders/j3/zdf8571x7cx8q0m |
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
Time.zone = ActiveSupport::TimeZone[-6].name | |
InterviewSlot.new(:start_time => Time.new(2012, 7, 7, 11, 30), :end_time => Time.new(2012, 7, 7, 12, 15)) | |
got: "Saturday July 7th from 9:30 to 10:15 AM" | |
Time.zone = ActiveSupport::TimeZone[-5].name | |
InterviewSlot.new(:start_time => Time.new(2012, 7, 7, 11, 30), :end_time => Time.new(2012, 7, 7, 12, 15)) | |
got: "Saturday July 7th from 10:30 to 11:15 AM" | |
Time.zone = ActiveSupport::TimeZone[-4].name | |
InterviewSlot.new(:start_time => Time.new(2012, 7, 7, 11, 30), :end_time => Time.new(2012, 7, 7, 12, 15)) |
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
#!bash | |
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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 Email | |
def initialize(address) | |
@address = address | |
end | |
def address | |
@address.strip | |
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
class Invitation < ActiveRecord::Base | |
attr_accessible :email_body, :email_subject, :project_id, :email_addresses | |
attr_accessor :email_addresses | |
belongs_to :project | |
validates_presence_of :project, :email_subject, :email_body, :email_addresses | |
validate :email_addresses_are_valid | |
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 Email | |
def initialize(address) | |
@address = address | |
end | |
def valid? | |
@address.match(email_regex) | |
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
validates_presence_of :name, :if => :require_name, :on => :update | |
validates_presence_of :email, :if => :require_email, :on => :update | |
validates_presence_of :phone, :if => :require_phone, :on => :update | |
def method_missing(name) | |
if name.to_s =~ /require_\w+/ | |
project.present? && project.send(name) | |
else | |
super | |
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
group :test, :development do | |
gem 'capybara' | |
gem 'capybara-webkit' | |
gem 'database_cleaner' | |
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
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? |