In your command-line run the following commands:
brew doctor
brew update
In your command-line run the following commands:
brew doctor
brew update
class Function | |
attr_reader :name, :fn | |
class Composed | |
attr_reader :left, :right | |
def initialize(left, right) | |
@left = left | |
@right = right | |
end |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
module RadiumIo | |
class WebObject < OpenStruct | |
def initialize(attrs = {}, &block) | |
super | |
yield self if block_given? | |
end | |
def self.create(attributes = {}, &block) | |
account = new attributes, &block | |
account.save |
guard 'rspec', :version => 2 do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |
$ ps -ax | |
$ #Kill all the related mysql process and direct run the next lines# | |
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking & | |
#direct log after execute bellow command# | |
$ mysql -u root | |
mysql > database mysql; |
require 'bcrypt' | |
class User | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
include BCrypt | |
attr_accessor :password, :password_confirmation | |
attr_protected :password_hash | |
# Bulk API design | |
# | |
# resources :posts | |
class PostsController < ActiveController::Base | |
# GET /posts/1,4,50,90 | |
# post_url([ @post, @post ]) | |
def show_many | |
@posts = Post.find(params[:ids]) | |
end |