Skip to content

Instantly share code, notes, and snippets.

View Serabe's full-sized avatar

Sergio Arbeo Serabe

View GitHub Profile
[alias]
st = status
ci = commit
co = checkout
svnup = svn fetch
sup = svn fetch
svnci = svn dcommit
sci = svn dcommit
up = pull --rebase
sreb = svn rebase
# 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.
[nokogiri-git (java)]$ jruby -S rake java:spec --trace
(in /Users/stephen/dev/ruby/src/gems/nokogiri-git)
warning: couldn't activate the debugging plugin, skipping
** Invoke java:spec (first_time)
** Invoke lib/nokogiri/css/generated_parser.rb (first_time, not_needed)
** Invoke lib/nokogiri/css/parser.y (first_time, not_needed)
** Invoke lib/nokogiri/css/generated_tokenizer.rb (first_time, not_needed)
** Invoke lib/nokogiri/css/tokenizer.rex (first_time, not_needed)
** Invoke java:build (first_time)
** Invoke java:clean_jar (first_time)
require 'clojure'
class MyClojureObj < Clojure::Object
def initialize
dosync { @foo = 'foo' }
end
def foo; @foo; end
def foo=(f); @foo = f; end
end
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix.
;;
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;;
;; * :import refers Java classes to the current namespace.
;;
@Serabe
Serabe / tribute.rb
Created February 23, 2010 09:29 — forked from burke/tribute.rb
def Dsl &b
Class.new{
def r&b;instance_exec &b
end; def method_missing s,*_
@m=[s,*@m];end}.new.r &b
;;; all code in this function lifted from the clojure-mode function
;;; from clojure-mode.el
(defun clojure-font-lock-setup ()
(interactive)
(set (make-local-variable 'lisp-indent-function)
'clojure-indent-function)
(set (make-local-variable 'lisp-doc-string-elt-property)
'clojure-doc-string-elt)
(set (make-local-variable 'font-lock-multiline) t)

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

# Simple Git Analyzer
#
# WORK IN PROGRESS :)
#
# Tobin Harris ([email protected])
# http://tobinharris.com
# http://engineroomapps.com
# Class to analyze git log
require 'rubygems'
# Monkey-patch LoadError's message to include the current $LOAD_PATH.
class LoadError
def message
super + "\ncurrent path:\n" + $LOAD_PATH.join("\n")
end
end