Skip to content

Instantly share code, notes, and snippets.

View chriscooning's full-sized avatar
🛠️
Building cool stuff

Chris Cooning chriscooning

🛠️
Building cool stuff
View GitHub Profile
@chriscooning
chriscooning / gist:9648103
Created March 19, 2014 18:26
migration modify
class CreateSurveys < ActiveRecord::Migration
def change
create_table :surveys do |t|
t.integer :author_id, null: false
t.text :customer_name, null: false
t.string :phone, null: true
t.text :address, null: true
t.string :zipcode, null: true
t.string :city, null: true
t.string :state, null: true, limit: 2
@chriscooning
chriscooning / gist:9496668
Created March 11, 2014 22:47
BC video fix
<h4>
<span style="font-size: 12pt;">Vincent DeFilippi</span>
</h4>
<p>
<span style="font-size: 10pt;">Our Top Doc is making a house call. In this Ask the Experts video, Dr. DeFilippi talks about valvular heart disease and your options for treatment.</span>
</p>
<object width="486" height="412" data="http://c.brightcove.com/services/viewer/federated_f9?isVid=1" type="application/x-shockwave-flash">
<param name="flashVars" value="@videoPlayer=3292208712001&playerID=50773277001&playerKey=AQ~~,AAAAC8PYRbk~,wKFKP7e2mxJPeHP2yvs2r7vzrxw2PYzh&domain=embed&dynamicStreaming=true" />
@chriscooning
chriscooning / iOS5 link fixer
Created August 12, 2013 20:16
fixes links within webpage "app" in iOS5 - forces links to stay in native view rather than opening in safari
@chriscooning
chriscooning / gist:6093869
Last active December 20, 2015 07:29
check_in.rb
class Factories::CheckIn
def initialize(options = {})
@options = options || {}
end
def create(attributes)
build(nil, attributes).tap do |check_in|
validate_user_schedule_existance(check_in)
validate_check_in_date(check_in) if @options[:fastpass]
@chriscooning
chriscooning / gist:6093819
Created July 27, 2013 05:21
timezone fix
def validate_check_in_date(entity)
if entity.user_schedule && day = entity.user_schedule.try(:department_block).try(:day)
entity.errors.add(:created_at, :not_assigned) if day.to_date != Time.zone.now.to_date
end
end
//