-
Install OS X
-
Install XCode
-
Install Homebrew
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
-
Install mysql & git & anything else you need
brew install git >
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
/* | |
* a smart poller for jquery. | |
* (by github) | |
* | |
* simple example: | |
* | |
* $.smartPoller(function(retry) { | |
* $.getJSON(url, function(data) { | |
* if (data) { | |
* doSomething(data) |
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
;; Align command !!! | |
;; from http://stackoverflow.com/questions/3633120/emacs-hotkey-to-align-equal-signs | |
;; another information: https://gist.github.com/700416 | |
;; use rx function http://www.emacswiki.org/emacs/rx | |
(defun align-to-colon (begin end) | |
"Align region to colon (:) signs" | |
(interactive "r") |
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
~/projects/jruby ➔ jruby memory_mapped.rb | |
Reading and writing memory-mapped | |
2.355000 0.000000 2.355000 ( 2.299000) | |
1.943000 0.000000 1.943000 ( 1.942000) | |
2.014000 0.000000 2.014000 ( 2.014000) | |
1.899000 0.000000 1.899000 ( 1.899000) | |
1.870000 0.000000 1.870000 ( 1.870000) | |
Reading from disk | |
2.982000 0.000000 2.982000 ( 2.982000) | |
3.031000 0.000000 3.031000 ( 3.031000) |
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
0% jruby -rubygems trouble/twitter/twitter4j.rb | |
Rehearsal ----------------------------------------------- | |
twitter gem 5.856000 0.000000 5.856000 ( 5.856000) | |
rubytter 5.844000 0.000000 5.844000 ( 5.845000) | |
twitter4j 1.730000 0.000000 1.730000 ( 1.730000) | |
------------------------------------- total: 13.430000sec | |
user system total real | |
twitter gem 4.850000 0.000000 4.850000 ( 4.850000) | |
rubytter 5.110000 0.000000 5.110000 ( 5.111000) |
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
namespace :assets do | |
task :rebuild do | |
# Config the base names of all the jammit CSS packages you have defined | |
# in assets.yml. Could probably parse assets.yml to get this if | |
# we wanted to. | |
packages = ['common'] | |
# This is because on OS X, you have to put an explicit empty string to the | |
# required extension argument with the -i parameter, but on Linux you | |
# do not. |
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
/* | |
--- | |
name: guilloche | |
script: guilloche.js | |
description: guilloche | |
provides: [Guilloche] | |
... | |
*/ |
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
// http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands | |
Raphael.fn.arc = function(startX, startY, endX, endY, radius1, radius2, angle) { | |
var arcSVG = [radius1, radius2, angle, 0, 1, endX, endY].join(' '); | |
return this.path('M'+startX+' '+startY + " a " + arcSVG); | |
}; | |
Raphael.fn.circularArc = function(centerX, centerY, radius, startAngle, endAngle) { | |
var startX = centerX+radius*Math.cos(startAngle*Math.PI/180); | |
var startY = centerY+radius*Math.sin(startAngle*Math.PI/180); | |
var endX = centerX+radius*Math.cos(endAngle*Math.PI/180); |
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
(use 'clojure.contrib.monads) | |
(defn new-pair [value log] {:value value :log log}) | |
(defn starting-pair [value] (new-pair value nil)) | |
(defn log [base-value] | |
(fn [log] | |
(new-pair base-value (cons base-value log)))) | |
(defmonad logging-m |
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 'active_record' | |
ActiveRecord::Base.logger = Logger.new(STDERR) | |
ActiveRecord::Base.colorize_logging = false | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:dbfile => ":memory:" | |
) |
OlderNewer