Skip to content

Instantly share code, notes, and snippets.

View jlindley's full-sized avatar

Jim Lindley jlindley

View GitHub Profile
jlindley@hypatia:~/Projects/AMS/site_assign[master]$ st
# On branch master
nothing to commit (working directory clean)
jlindley@hypatia:~/Projects/AMS/site_assign[master]$ mate .
jlindley@hypatia:~/Projects/AMS/site_assign[master]$
jlindley@hypatia:~/Projects/AMS/site_assign[master*]$ st
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
module Kernel
def other
o = []
ObjectSpace.each_object{|obj| o << obj unless (o==self)}
o
end
end
class Teapot
# new branches appropriately merge from the starting point branch
git config --global branch.autosetupmerge true
# pull from origin and merge by default
git config --global branch.master.remote origin
git config --global branch.master.merge refs/heads/master
jlindley@hypatia:~$ rvm -v
rvm 0.1.32 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]
jlindley@hypatia:~$ rvm install rbx
Installing pre-requisites
Extracting rubinius-1.0.0-20100514.tar.gz ...
mv: rename /Users/jlindley/.rvm/src/rubinius-1.0.0 to /Users/jlindley/.rvm/src/rbx-1.0.0-20100514/rubinius-1.0.0: Directory not empty
Configuring rbx
Compiling rbx
Do you think it is a good idea to do downcase and a == or is there a better way?
def nbde_new_evaluation_result(nbde_evaluation)
letter = nbde_evaluation.part1_test_result.downcase
if letter == "p"
"Pass"
elsif letter == "f"
"Fail"
else
"Unknown"
# Easily inspect any list of objects in logger.
# Provided as a hack to the standard ruby (or Rails) logger:
#
# Example Code:
#
# # in some_file.rb
# chicken = :fred
# all_the_birds = [chicken, :roadrunner]
# my_logger.inspector(chicken, all_the_birds) # outputs to log:
#
@jlindley
jlindley / pre-commit
Created November 11, 2010 22:50 — forked from jhsu/pre-commit
pre-commit hook for git, prevents console.log() statements
#!/bin/sh
# Don't allow console.log() statements to be committed.
#
# Add to .git/hooks/pre-commit
#
# Note: jquery.js seems to always include 1 reference
# in a debugging section, that one can be safely
# ignored. 1 reference to console.log is cool
@jlindley
jlindley / reserved_names.txt
Created January 8, 2011 06:06
Black list for account names or subdomains. Check for pluralized version of each, too, to be safe.
about
account
action
activity
add
admin
administration
affiliate
api
app
module Bar
def self.anon_struct
s = Struct.new(:foo, :bar, :baz)
oid = s.object_id
s = nil
oid
end
end
@jlindley
jlindley / right_assignments.yml
Created March 9, 2011 19:58
Right to add for dashboard
# under organization_user
dashboard:
- "use_dashboard"