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
| CREATE TABLE IF NOT EXISTS Timelines( | |
| name text, | |
| parent_id text, | |
| event_id uuid, | |
| PRIMARY KEY((parent_id, name), event_id) | |
| ) WITH CLUSTERING ORDER BY (event_id DESC) |
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
| # Often times we need to send emails on a delayed basis. We could make this really easy on the client | |
| # side by automatically mounting an endpoint with rack middleware, and firing the mailer with the | |
| # arguments supplied. | |
| # | |
| # Under the hood, this would use the same architecture as an abstract job, where a webhook is hit | |
| # at the specified time, but by focusing on the email / action mailer use case the client doesn't need | |
| # to write any boilerplate code. | |
| Tick::EmailJob.create!( | |
| :at => appointment.start_time - 1.hour, | |
| :message => "Don't forget, your appointment starts in 1 hour!", |
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
| { | |
| "steps": { | |
| "original": { | |
| "use": ":original", | |
| "robot": "/image/resize" | |
| }, | |
| "pdf": { | |
| "use": ":original", | |
| "robot": "/document/thumbs", | |
| "page": 1 |
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
| #!/usr/bin/env ruby | |
| require 'json' | |
| app_name = 'APP_NAME' | |
| opsworks_app_id = 'APPID' | |
| config = `heroku config -s --app #{app_name}`.strip | |
| json = [] |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head> | |
| <title>Test Page</title> | |
| <script type="text/javascript" src="js/prototype-1.6.0.3.js"></script> | |
| <script type="text/javascript" src="js/livepipe/livepipe.js"></script> | |
| <script type="text/javascript" src="js/livepipe/window.js"></script> | |
| <script type="text/javascript"> |
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
| def make_friends(user, target) | |
| transaction do | |
| begin | |
| Friend.find(:first, :conditions => {:inviter_id => user.id, :invited_id => target.id, :status => PENDING}).update_attribute(:status, ACCEPTED) | |
| Friend.create!(:inviter_id => target.id, :invited_id => user.id, :status => ACCEPTED) | |
| rescue Exception | |
| return make_friends( target, user) if user.followed_by? target | |
| return add_follower(user, target) | |
| end | |
| end |
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
| include AASM | |
| include AASM::Persistence | |
| aasm_column :status | |
| aasm_initial_state Proc.new { |task| task.assignments.empty? ? :not_started } | |
| aasm_state :not_started | |
| aasm_state :in_progress | |
| aasm_state :completed | |
| aasm_event :start_task do |
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
| require "autotest/growl" | |
| require "autotest/fsevent" | |
| require 'autotest/restart' | |
| Autotest.add_hook :initialize do |at| | |
| at.unit_diff = 'cat' | |
| end | |
| Autotest.add_hook :ran_command do |at| |
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
| Task.find(:all, :include => [{:assignments => :task}], :conditions => ["assignments.assignee_id = ? AND assignments.status = ?", u.id, "accepted"]) |
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
| # visit.rb | |
| Factory.define :visit do |f| | |
| f.patient { |a| a.association(:patient) } | |
| f.clinic { |a| a.association(:clinic) } | |
| end | |
| # patient.rb | |
| # Defines a new sequence | |
| Factory.sequence :email do |n| | |
| "person#{n}@example.com" |
OlderNewer