This file contains hidden or 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
Object.byString = function(o, s) { | |
s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties | |
s = s.replace(/^\./, ''); // strip a leading dot | |
var a = s.split('.'); | |
while (a.length) { | |
var n = a.shift(); | |
if (n in o) { | |
o = o[n]; | |
} else { | |
return; |
This file contains hidden or 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
var uniqueID = (function() { | |
var id = 0; // This is the private persistent value | |
// The outer function returns a nested function that has access | |
// to the persistent value. It is this nested function we're storing | |
// in the variable uniqueID above. | |
return function() { return id++; }; // Return and increment | |
})(); // Invoke the outer function after defining it. |
This file contains hidden or 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
silence_warnings do | |
begin | |
require 'pry' | |
IRB = Pry | |
rescue LoadError | |
end | |
end |
This file contains hidden or 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
3425198 2012-08-22 12:41:34 public add this to config/envoronments/development.rb to set pry as default rails console | |
3129493 2012-07-17 13:50:22 public find diffs in hashes |
NewerOlder