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 "rubygems" | |
require "rake" | |
puts `ps -orss -p#{Process.pid}` | |
# Result | |
# RSS | |
# 6564 |
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
import re | |
import glob | |
import os | |
for i in files: | |
i = re.sub("papers", "notes", i.lower()) | |
i = re.sub(" ", ".", i) | |
i = re.sub("[-,?():]", "", i) | |
i = re.sub("\.+", ".", i) |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
if !ARGV[0] | |
puts "Usage: iphone.rb STATE" |
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
Router.prepare do |r| | |
# generating this requires :domain, :controller, and :action | |
r.match("/:domain/complicated/url").to(:controller => "what", :action => "index") | |
# generating this requires :controller and :index | |
r.match("/:controller/:index").to | |
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
require "logger" | |
def memory | |
x = 1 # Make a scope | |
`ps -p#{Process.pid} -orss`.split("\n")[1].to_i | |
end | |
def logger | |
p memory | |
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
Screw.XHR = function() {}; | |
Screw.XHR.returns = function(str, type, status) { | |
codes = { | |
100: "Continue", | |
101: "Switching Protocols", | |
200: "OK", | |
201: "Created", | |
202: "Accepted", | |
203: "Non-Authoritative Information", | |
204: "No Content", |
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 "logger" | |
def memory | |
x = 1 # Make a scope | |
`ps -p#{Process.pid} -orss`.split("\n")[1].to_i | |
end | |
def objects | |
ret = 0 | |
ObjectSpace.each_object {|o| ret += 1} |
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
Over the past week, Merb has been working on merging our core extension library | |
with DataMapper's, to provide a single non-conflicting library for both Merb | |
and DataMapper to use. Unfortunately, it has caused some confusion for people | |
who use edge merb but do not really dive into development process. | |
Here's what changed and why: | |
* Merb core extensions and support classes were extracted into merb-extlib. | |
* merb-extlib was merged with DataMapper's extlib on a separate branch. | |
* merb-core, merb-more, merb-plugins all have a branch where the merged extlib |
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
>> Salesforce::SelfServiceUser.get!('0057000000172YTAAY') | |
Query Object: #<DataMapper::Query @repository=:salesforce @model=Salesforce::SelfServiceUser @fields=[#<Property:Salesforce::SelfServiceUser:id>, #<Property:Salesforce::SelfServiceUser:username>] @links=[] @conditions=[] @order=[] @limit=1 @offset=0 @reload=false @unique=false> | |
Result: #<Salesforce::SelfServiceUser username="[email protected]" id="03570000000hzJZAAY"> |
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
diff --git a/lib/dm-core/property.rb b/lib/dm-core/property.rb | |
index cf5726b..4a5a16a 100644 | |
--- a/lib/dm-core/property.rb | |
+++ b/lib/dm-core/property.rb | |
@@ -279,7 +279,7 @@ module DataMapper | |
attr_reader :primitive, :model, :name, :instance_variable_name, | |
:type, :reader_visibility, :writer_visibility, :getter, :options, | |
- :default, :precision, :scale, :track | |
+ :default, :precision, :scale, :track, :extra_options |
OlderNewer