Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'clojure' | |
class MyClojureObj < Clojure::Object | |
def initialize | |
dosync { @foo = 'foo' } | |
end | |
def foo; @foo; end | |
def foo=(f); @foo = f; end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; 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. | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Dsl &b | |
Class.new{ | |
def r&b;instance_exec &b | |
end; def method_missing s,*_ | |
@m=[s,*@m];end}.new.r &b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Git Analyzer | |
# | |
# WORK IN PROGRESS :) | |
# | |
# Tobin Harris ([email protected]) | |
# http://tobinharris.com | |
# http://engineroomapps.com | |
# Class to analyze git log | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer