Skip to content

Instantly share code, notes, and snippets.

View pjfitzgibbons's full-sized avatar

Peter Fitzgibbons pjfitzgibbons

View GitHub Profile
[2017-06-13 12:33:35] gemset_import_list
gemset_import_list ()
{
case "${rvm_ruby_string}" in
*jruby*)
\command \gem install "$@"
;;
*)
\typeset line;
root@555a75f20bd1:~/shoes4# rvm install jruby-9.1.10.0
Unknown ruby string (do not know how to handle): jruby-9.1.10.0.
Unknown ruby string (do not know how to handle): jruby-9.1.10.0.
Searching for binary rubies, this might take some time.
Unknown ruby string (do not know how to handle): jruby-9.1.10.0.
Unknown ruby string (do not know how to handle): jruby-9.1.10.0.
Found remote file https://s3.amazonaws.com/jruby.org/downloads/9.1.10.0/jruby-bin-9.1.10.0.tar.gz
Checking requirements for debian.
Installing requirements for debian.
Updating system..
@pjfitzgibbons
pjfitzgibbons / Blockchain
Created March 20, 2016 15:47
Blockchain
Verifying that +pjfitzgibbons is my blockchain ID. https://onename.com/pjfitzgibbons
@pjfitzgibbons
pjfitzgibbons / post-receive
Created October 5, 2011 14:51
git post-receive for conditional Jenkins run
#!/usr/bin/env ruby
require '~/bin/webapp-post-receive'
old_head, new_head, ref = STDIN.gets.split
redmine_project = 'redmine-project-name'
ci_project = 'jenkins-project-name'
WebappPostReceive.process(:redmine_project => redmine_project,
@pjfitzgibbons
pjfitzgibbons / Environment and config.sh
Created July 28, 2011 10:28
TinyTDS timeout on network failure of open connection
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
# Blocking also occurs with:
$ jruby -v
jruby 1.6.2 (ruby-1.8.7-p330) (2011-05-23 e2ea975) (Java HotSpot(TM) Client VM 1.6.0_26) [darwin-i386-java]
$ gem list
*** LOCAL GEMS ***
# Run me with:
# $ watchr docs.watchr
require 'yard'
# --------------------------------------------------
# Rules
# --------------------------------------------------
watch( 'app/controllers/.*\.rb' ) { yard }
watch( 'README' ) { yard }
class User < ActiveRecord::Base
PROFILE_KEYS = %w/ first_name last_name office_phone home_phone cell_phone /
def self.moderator_fields
key_val_pairs = @params.select {|k,v| not PROFILE_KEYS.include? k}.flatten
Hash[*key_val_pairs]
end
def self.profile_fields
key_val_pairs = @params.select {|k,v| PROFILE_KEYS.include? k }.flatten