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
➜ 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: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
#
@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
#!/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 / 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|
@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"
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"
~/projects/git/manFS > rvm info
ruby-1.8.7-p249@manfs:
system:
uname: "Darwin boole.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
script/generate gives me :
Rubygems: cucumber, culerity, feature, form, formtastic, formtastic_stylesheets, nifty_authentication, nifty_config, nifty_layout, nifty_scaffold, revisable_migration, session
Builtin: controller, helper, integration_test, mailer, metal, migration, model, observer, performance_test, plugin, resource, scaffold, session_migration
> bundle exec script/generate
Usage: script/generate generator [options] [args]
Rails Info:
# remove Prototype defaults
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
# add XHTML 1.0 Strict layout, with jQuery from Google
file 'app/views/layouts/application.html.erb', <<-ERB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">