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
{"task_id"=>"ZpN0lCQqbH", | |
"status"=>"Complete", | |
"started_at"=>"2012-12-24 20:38:17 -0800", | |
"completed_at"=>"2012-12-24 20:40:57 -0800", | |
"resources"=> | |
"[ | |
{ | |
\"image_url\":\"http://upload.wikimedia.org/wikipedia/commons/1/19/Tanzanian_Animals.jpg\", | |
\"TextInput1\":\"Zebra\", | |
\"extras\":{ |
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
#!/bin/bash | |
# Requirements: sed, grep, curl, pkill | |
# User configuration | |
LOCAL_INSTALL="/usr/lib/sublime-text-2" # Must be user-writable | |
REPO="dev" # "dev" for dev releases, or "2" for beta releases | |
TARGET_BUILD="Linux 32 bit" # can be one of "Windows", "Windows 64 bit", "OS X", "Linux 32 bit", "Linux 64 bit" | |
# Check if sublime text is running |
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
--colour | |
-I app |
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
# inspired by http://blog.leshill.org/blog/2011/10/23/fast-specs.html | |
# to get specs running without rails (faster) do | |
# SKIP_RAILS=yes time bundle exec rspec | |
# or | |
# SKIP_RAILS=yes time bundle exec guard | |
# spec_helper |
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
module FactoryGirlAdditions | |
# create instance without running callbacks and validations | |
def insert(*args) | |
record = FactoryGirl.build(*args) | |
def record.run_callbacks(*args, &block) | |
if block_given? | |
block.arity.zero? ? yield : yield(self) | |
end | |
end | |
record.save! |
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
# This custom matcher can be used to test state machine | |
# | |
# Examples | |
# | |
# it { should have_event(:status, :event_name, [:state1, :state2] => [:state3, :state4]) } | |
# it { should have_event(:status, :event_name, { | |
# :state1 => :state3, | |
# :state1 => :state4, | |
# :state3 => :state3, | |
# :state2 => :state4 |
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
# This custom matcher can be used to test state machine | |
# | |
# Examples | |
# | |
# it { should have_event(:status, :event_name, [:state1, :state2] => [:state3, :state4]) } | |
# it { should have_event(:status, :event_name, { | |
# :state1 => :state3, | |
# :state1 => :state4, | |
# :state3 => :state3, | |
# :state2 => :state4 |
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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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
#!/bin/sh | |
# Script to perform consistency checks on replicated MySQL databases | |
# | |
# (c) Alex Williams - 2009 - www.alexwilliams.ca | |
# | |
# v0.1 | |
# | |
# Options: | |
# -c Check for inconsistent slaves |
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 ApiLogger < Grape::Middleware::Base | |
def before | |
Rails.logger.info "[api] Requested: #{request_log_data.to_json}\n" + | |
"[api] #{response_log_data[:description]} #{response_log_data[:source_file]}:#{response_log_data[:source_line]}" | |
end | |
private | |
def request_log_data |
OlderNewer