Skip to content

Instantly share code, notes, and snippets.

Michael Moen UnderpantsGnome

Block or report user

Report or block UnderpantsGnome

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@UnderpantsGnome
UnderpantsGnome / Gemfile
Created Feb 27, 2018
Integration testing React with a Rails API using RSpec
View Gemfile
...
group :test do
gem 'capybara', '~> 2.4.4'
gem 'capybara-screenshot', '~> 1.0.11'
gem 'database_cleaner'
gem 'launchy', '~> 2.4.3'
gem 'rspec-rails'
gem 'selenium-webdriver'
end
View mysql.rb
require 'formula'
class Mysql < Formula
homepage 'http://dev.mysql.com/doc/refman/5.1/en/'
url 'http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-5.1.60.tar.gz'
md5 '076d61d5f9b0de4e51b6c48a5e576035'
depends_on 'readline'
def options
@UnderpantsGnome
UnderpantsGnome / pre-commit
Last active Sep 27, 2015
My pre-commit hook
View pre-commit
#!/bin/bash
debug=`git diff --cached | grep -C 2 -E '+\s*And (open|show me the page|save_and_open_page)'`
pry=`git diff --cached | grep -C 2 -E 'binding.pry'`
debugger=`git diff --cached | grep -C 2 debugger`
console_log=`git diff --cached | grep -C 2 console.log`
conflicts=`git diff --cached | grep -C 2 -E '<<<|>>>'`
if [ -n "$debug" ]; then
echo "debugging statements added in this commit"
@UnderpantsGnome
UnderpantsGnome / queue_failure_session_proxy.rb
Created May 4, 2011
DJ Queue Failed Solr calls for index and remove
View queue_failure_session_proxy.rb
require 'sunspot/session_proxy/silent_fail_session_proxy'
module Sunspot
module SessionProxy
class QueueFailureSessionProxy < Sunspot::SessionProxy::SilentFailSessionProxy
QUEUE_METHODS = [:index!, :index, :remove!, :remove]
def rescued_exception(method_name, ex, klass)
raise ex unless ::Rails.env.production?
View poor mans rvm gems load
#!/usr/bin/env ruby
File.open('gemlist').each do |line|
next if line =~ /^#/
g, v = line.split
ret = system("gem install #{g} #{v} --no-rdoc --no-ri") if g && v
p $? unless ret
end
View gist:293985
mmoen@shiny:~$ !echo
echo $PATH | tr ":" "\n"
/Users/mmoen/.rvm/rubies/ruby-1.8.6-p383/bin
/Users/mmoen/.rvm/gems/ruby-1.8.6-p383%strappy/bin
/Users/mmoen/.rvm/gems/ruby-1.8.6-p383%strappy%global/bin
/Users/mmoen/.rvm/bin
/opt/local/bin
/opt/local/sbin
/Users/mmoen/bin
/usr/local/mysql/bin
View gist:291859
The following scenario leads to the below gem paths. Not sure how/where to fix it.
rvm 1.9.1
rvm 1.8.6
- GEM PATHS:
- /Users/tukaiz/.rvm/gems/ruby-1.8.6-p383
- /Users/tukaiz/.rvm/gems/ruby-1.8.6-p383%global
- /Users/tukaiz/.rvm/gems/ruby-1.9.1-p378%global
@UnderpantsGnome
UnderpantsGnome / gist:289486
Created Jan 29, 2010
rvm global gems per ruby
View gist:289486
########################################
### Start with a "clean" environment ###
########################################
mmoen@shiny:~/tmp$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin10.2.0]
- INSTALLATION DIRECTORY: /Users/mmoen/.rvm/gems/ruby/1.8.6
- RUBY EXECUTABLE: /Users/mmoen/.rvm/ruby-1.8.6-p383/bin/ruby
View miniskirt.rb
# Factory girl, relaxed.
#
# Factory.define :user do |f|
# f.login 'johndoe%d' # Sequence.
# f.email '%{login}@example.com' # Interpolate.
# f.password f.password_confirmation('foobar') # Chain.
# end
#
# Factory.define :post do |f|
# f.user { Factory :user } # Blocks, if you must.
View gist:128917
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a3a6afd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.gem
+
diff --git a/lib/sax-machine/sax_collection_config.rb b/lib/sax-machine/sax_collection_config.rb
index 3d22a08..88a637a 100644
You can’t perform that action at this time.