Skip to content

Instantly share code, notes, and snippets.

View ticktricktrack's full-sized avatar

Rainer Kuhn ticktricktrack

  • Groundsure
  • Brighton, UK
View GitHub Profile
@ticktricktrack
ticktricktrack / .pryrc
Created December 5, 2012 16:57
Rainer .pryrc
# switch default editor for pry to sublime text
Pry.config.editor = "subl"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
@ticktricktrack
ticktricktrack / apidoc.md
Created December 4, 2012 12:17
Mill33 Api Documentation
@ticktricktrack
ticktricktrack / api_matchers_example_specs.rb
Created October 26, 2012 16:34
APIMatchers example specs
### Gemfile
source 'https://rubygems.org'
gem 'rspec', '2.11.0'
gem 'api_matchers', '0.1.1'
### spec
require 'api_matchers'
include APIMatchers::RSpecMatchers
require 'json'
require "httparty"
require 'awesome_print'
class DynectPostBackTest
include HTTParty
base_uri 'https://emailapi.dynect.net/rest/json'
debug_output $stdout
@ticktricktrack
ticktricktrack / bundler.log
Created July 18, 2012 17:23
DEBUG_RESOLVER=1 bundle update
~/work$ cd bundle_check/
~/work/bundle_check$ DEBUG_RESOLVER=1 bundle update
Fetching gem metadata from https://rubygems.org/........
==== Iterating ====
Activated:
Requirements:
tidy_ffi (= 0.1.4) ruby
@ticktricktrack
ticktricktrack / api_taster_resque_web_stack_trace.rb
Created July 10, 2012 12:25
api_taster sinatra mount stack strace
api_taster (0.4.7) lib/api_taster/route.rb:34:in `block in normalise_routes!'
journey (1.0.4) lib/journey/routes.rb:28:in `each'
journey (1.0.4) lib/journey/routes.rb:28:in `each'
api_taster (0.4.7) lib/api_taster/route.rb:29:in `normalise_routes!'
api_taster (0.4.7) lib/api_taster/route.rb:16:in `map_routes'
api_taster (0.4.7) app/controllers/api_taster/routes_controller.rb:27:in `map_routes'
activesupport (3.2.6) lib/active_support/callbacks.rb:418:in `_run__3802028313801974835__process_action__2474343883616983151__callbacks'
activesupport (3.2.6) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.6) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
@ticktricktrack
ticktricktrack / resque.rake
Created June 26, 2012 08:29
ticket_13675 resque setup
# Resque tasks
require 'resque/tasks'
require 'resque_scheduler/tasks'
namespace :resque do
# slight modification of rake resque:work
# https://github.com/defunkt/resque/blob/master/lib/resque/tasks.rb
task :work_dont_fork => ["resque:preload", "resque:setup"] do
require 'resque'
@ticktricktrack
ticktricktrack / ticket_13675.log
Created June 25, 2012 15:32
ticket_13675.log
tail -n 500 newrelic_agent.log
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16548)] DEBUG : Uncompressed content returned
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16548)] DEBUG : Connect to collector-3.newrelic.com:80/agent_listener/8/8ad200de607a87ea5aea69753a686917843622b8/connect
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16548)] DEBUG : Http Connection opened to 204.93.223.153:80
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16565)] DEBUG : Uncompressed content returned
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16565)] DEBUG : Connect to collector-3.newrelic.com:80/agent_listener/8/8ad200de607a87ea5aea69753a686917843622b8/connect
[06/25/12 15:26:59 +0000 jobserver1.carrierpigeon-v2.production.ds.dfw1.incutio.com (16565)] DEBUG : Http Connection opened to 204.93.223.153:80
[06/25/12 15:26:59 +0000 job
Connecting to database specified by database.yml
New Relic Agent not running.
New Relic Agent not running.
(0.4ms) SELECT @@FOREIGN_KEY_CHECKS
(0.4ms) SET FOREIGN_KEY_CHECKS = 0
(0.2ms) BEGIN
Fixture Delete (0.4ms) DELETE FROM `accounts`
snip..
@ticktricktrack
ticktricktrack / spec_helper.rb
Created June 6, 2012 11:34
My crappy spec_helper with "performance tweaks" c&p'ed from various sources
# require 'simplecov'
# SimpleCov.start 'rails'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require "cancan/matchers"
require 'database_cleaner'