Mountain Lion (10.8) has three main difference compared to Lion (10.7):
- XCode 4.4 does not install Command Line Tools by default
- X11 isn't available anymore
- The installed version of OpenSSL has some bugs
require 'memoist' | |
# Usage: | |
# | |
# customers = Customer.preload(Customer.orders.line_items.item) | |
# | |
# customers.each do |customer| | |
# customer.orders.each do |order| | |
# order.line_items.each do |line_item| | |
# line_item.item # yay, no more N+1, only 4 queries executed ! |
#!/usr/bin/ruby | |
[ | |
'addressable.git', 'extlib.git', | |
'do.git/data_objects', 'do.git/do_mysql', | |
'dm-core.git', 'dm-migrations.git', 'dm-transactions.git', 'dm-do-adapter.git', 'dm-mysql-adapter-1.0.0', | |
].each do |path| | |
$:.unshift "common/gems/#{path}/lib" | |
end |
{ | |
"~f" = "moveWordForward:"; | |
"~b" = "moveWordBackward:"; | |
"~<" = "moveToBeginningOfDocument:"; | |
"~>" = "moveToEndOfDocument:"; | |
"~v" = "pageUp:"; | |
"^v" = "pageDown:"; | |
"~d" = "deleteWordForward:"; | |
"~^h" = "deleteWordBackward:"; | |
"~\Uf728" = "deleteWordForward:"; |
require 'digest/sha1' | |
class RefCode < ::DataMapper::Property::String | |
required true | |
unique_index true | |
default proc { |_, prop| prop.class.generate(prop.length) } | |
# Setting :format before passing on the initialization chain will cause | |
# dm-validations (if present) to auto-add a format validation for us. | |
# For some reason setting :length is not doing the same, so our format |
#!/usr/bin/ruby | |
s = "I really think this regexp engine sucks, why don't they just use PCRE?" | |
re = /((\w+\s*)+ regexp)$/ | |
re.match(s) | |
puts "NIH, muthafuckaz, NIH!!!!!!!!" # p.s you'll never see this line |
See associated gist for simple definitions of Project, User, Task, Answer models | |
referenced herein. | |
Summary: | |
I believe the logic about how JOINs are constructed needs to fundamentally | |
change. In order to create the correct JOIN SQL, the logic needs to be | |
aware of and account for how an individual query param's "links" are related | |
to each other *only*, instead of how they the query param's themselves | |
relate to each other (which is how I intepret how it works now). |
require "do_mysql" | |
require "dm-core" | |
require 'rubygems' | |
require 'ruby-debug' | |
Debugger.start | |
DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, "mysql://root@localhost/foo") |