Skip to content

Instantly share code, notes, and snippets.

View macarthy's full-sized avatar
💭
Looking for work

Justin MacCarthy macarthy

💭
Looking for work
View GitHub Profile
Background:
Given a product called "VCF-999"
And it has a description "A alignment and variant calling pipeline"
And it costs "$999"
Scenario: Adding the product to my basket
Given I am signed in as "user@test.com/please"
When I go to the homepage
And I press "VCF-999"
@macarthy
macarthy / Gemfile
Created July 13, 2011 17:11
Odd error with rspec, rails 3.10rc4 and should-matchers
group :test, :development do
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'passenger'
gem 'rspec-rails', '>= 2.6.1'
gem 'factory_girl_rails', '>= 1.1.beta1'
gem 'cucumber-rails', '>= 0.5.2'
gem 'capybara', '>= 1.0.0'
gem 'database_cleaner', '>= 0.6.7'
gem "rcov"
@macarthy
macarthy / sig_child_not_working.rb
Created July 20, 2011 12:28
Experimenting with forking, and monitoring processes in ruby
#!/usr/bin/ruby -w
# from : https://www.ruby-forum.com/topic/135350
# SIG_CHILD to monitor processes
trap_quit = lambda { |sig|
#!/bin/bash
apt-get install gcc g++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-g eneric libsqlite3-dev
mkdir ~/src
cd ~/src/
mkdir ruby1_9
cd ruby1_9/
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz
@macarthy
macarthy / gist:1170094
Created August 25, 2011 06:18
use the rails or merb logger if in use
# stolen from delayed_job
cattr_accessor :logger
self.logger = if defined?(Merb::Logger)
Merb.logger
elsif defined?(RAILS_DEFAULT_LOGGER)
RAILS_DEFAULT_LOGGER
end
@macarthy
macarthy / gist:1526378
Created December 28, 2011 04:52
/usr/bin/shasum5.10.0 on osx
#!/usr/bin/perl5.10.0
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
$0 =~ s/\d+\.\d+\.\d$//;
#!perl -w
# shasum: filter for computing SHA digests (analogous to sha1sum)
#
# Copyright (C) 2003-2007 Mark Shelor, All Rights Reserved
#
➜ gittest git:(master) git log
commit 6be414305b3f968f975c3d33cd86b9d9beb17f77
Author: Justin MacCarthy <Justin@Rubystars.biz>
Date: Wed Dec 28 14:37:46 2011 +0700
added c.txt
commit 954758efede9490e3e1b87753402e95f64ce7263
Author: Justin MacCarthy <Justin@Rubystars.biz>
Date: Wed Dec 28 14:37:28 2011 +0700
@macarthy
macarthy / gist:3022968
Created June 30, 2012 08:36
hacking barcamp
//todo
@macarthy
macarthy / gist:5110083
Last active December 14, 2015 15:48
slow postgresql query
Column | Type | Modifiers | Storage | Stats target | Description
------------------------+-----------------------------+---------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('tags_id_seq'::regclass) | plain | |
type | character varying(255) | | extended | |
label | character varying(255) | | extended | |
created_at | timestamp without time zone | not null | plain | |
updated_at | timestamp without time zone | not null | plain | |
Indexes:
"tags_pkey" PRIMARY KEY, btree (id)
"add_uni
require 'prawn'
def header
grid([0,0],[1,3]).bounding_box do
bounding_box([0,cursor], :width => 200, :height => 30) do
fill_color "d7800f"
fill_rectangle [bounds.left,bounds.top],bounds.width,bounds.height
stroke_bounds
end