Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
| require 'eventmachine' | |
| module Blackhole | |
| def post_init | |
| puts "CONNECT" | |
| end | |
| def receive_data data | |
| puts "RECEIVE: #{data}" | |
| end |
| // ==UserScript== | |
| // @name Hide Images | |
| // @namespace http://fluidapp.com | |
| // @description Adds a button to hide images | |
| // @include * | |
| // @author Someone | |
| // ==/UserScript== | |
| // originally from: https://gist.github.com/1649063 |
| class Cell<T> { | |
| let cell: T[] | |
| var value: T { | |
| get { return cell[0] } | |
| } | |
| init (_ value:T) { | |
| self.cell = [value] | |
| } |
| # When using this, be careful about your testing transactions. | |
| # ActiveRecord after_commit hooks don't play nice with transactional fixtures | |
| # consider adding the test_after_commit gem to your test group | |
| ActiveRecord::Base.class_eval do | |
| DEFERRED_KEY = "deferred" | |
| def touch_with_defer(name = nil) | |
| raise ActiveRecordError, "cannot touch on a new record object" unless persisted? | |
| defer_until_commit([self.class.name, id, name, "touch"].map(&:to_s).join(":")) { touch_without_defer(name) } | |
| end |
| (defn- split-lines | |
| "Takes a sequence of content chunks and returns a lazy sequence of individual lines. | |
| (\"abc\" \"de\\nabc\") becomes (\"abcde\" \"abc\")" | |
| [stream] | |
| (let [ | |
| chunk (first stream) | |
| remainder (rest stream) | |
| [line leftover] (string/split chunk #"\n+" 2)] | |
| (if leftover | |
| (lazy-seq (cons line (split-lines (cons leftover remainder)))) |
| def update | |
| user = User.find(1) | |
| if user.update_attributes(params[:user]) | |
| respond_with(@user) | |
| else | |
| respond_with(@user.errors, :status => :unprocessable_entity) | |
| end | |
| end |