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: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
//
@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 / 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: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 / 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:9902732
Created March 31, 2014 21:25
Improvement for City of Monterey parking information landing page
<div class="Normal" style="padding: 15px;background-color: rgb(255, 247, 190);border-radius:5px;border-color:red;border:1px;margin-top:15px;"><br>
<br>
<h1>Recently recieved a parking citation?</h1><h2>Payment Options</h2>
1. Pay Citation by Check of Money Order: To pay your citation with a personal check or money order. (no cash accepted). Mail the citation with the appropriate payment to: <br><br>
<strong>City of Monterey Parking Enforcement Center <br> P.O. BOX&nbsp;6010 <br> Inglewood, CA 90312-6010</strong><br>
<br><p>
2. Pay Citation with Credit Card: Citations may be paid with a credit card through the internet Click on the link below to pay your citation now. Please have your citation number or license plate number available. The City's citation processor uses EZPayCorp, which&nbsp;charges a convenience fee of $3.95 per transaction for citations&nbsp;less than $99.99. For citations equal to or greater that $100 the fee is 5% of the fine.</p>
<br>
@chriscooning
chriscooning / gist:10371602
Created April 10, 2014 11:35
volunteer tracker - enhanced error
<div class="alert-container">
<div class="alert alert-warning" style="
padding-right: 35px;
padding-bottom: 45px;
">
<h3>Uh-Oh! We need a few corrections from you in order to fully import your list...</h3> <div>
<table class="table table-bordered table-striped">
<tbody><tr>
@chriscooning
chriscooning / gist:0c9535ef3e6c74e59698
Created May 21, 2014 16:27
DMC sample json response
[
{
"gallery_id": 1,
"link": "http://user.digitalmediacenter.com/galleries/1?invitation_hash=5ce1bb8163b385ba56cc584afc0eca09"
},
{
"gallery_id": 3,
"link": "http://user.digitalmediacenter.com/galleries/1?invitation_hash=233e04de2367c53c78b03026549ffb40"
}
]
.container
#contact_form.row
.col-12.col-sm-12.col-lg-12
h2 Tell Us What You Think...
p We appreciate any feedback about your overall experience on our site or how to make it even better. Please fill in the below form with any comments and we will get back to you.
form#feedbackForm role="form"
.form-group.has-feedback
label.control-label for="name" Name
input#name.form-control.input-sm name="name" type="text" /
span.help-block style=("display: none;") Please enter your name.
(function(){
//------------------------------
// Mesh Properties
//------------------------------
var MESH = {
width: 1.2,
height: 1.2,
depth: 10,
segments: 16,