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 / ror.md
Created March 21, 2012 17:22
RoR dependencies

RoR setup instructions: I guess you already have XCode on your machine.

In general: avoid sudo where you can, with this setup you can install and run everything without sudo

homebrew

http://mxcl.github.com/homebrew/

here is a list of the packages on my machine

@ticktricktrack
ticktricktrack / rspec_runthrough.md
Created March 26, 2012 15:51
RSpec Runthrough March 2012

Rspec

Philosophy

The suite of tests is not there to satisfy the QA groups, it is not there to prove to other people that our code works. The suite of tests is there so that we can refactor. So that when we bring the code up to our screen then we're not afraid of it. @unclebobmartin

List of useful resources

@ticktricktrack
ticktricktrack / rvmstuff.sh
Created April 19, 2012 09:37
rvm and bundler commands
"check if your gemset will be automatically set, cd'ing into the folder should automatically activate the right one specified in .rvmrc"
"open new terminal window"
rvm gemset name
# should say /Users/rainer/.rvm/gems/ruby-1.9.3-p125
rvm gemset use global
# should say Using ruby-1.9.3-p125 with gemset global
cd work/carrier-pigeon
rvm gemset name
# should say v2
@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'
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 / 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
@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 / 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 / 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
require 'json'
require "httparty"
require 'awesome_print'
class DynectPostBackTest
include HTTParty
base_uri 'https://emailapi.dynect.net/rest/json'
debug_output $stdout