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
Backbone.React = {} unless Backbone.React | |
Backbone.React.Base = {} unless Backbone.React.Base | |
### | |
Backbone React Base Mixin | |
========================= | |
Usage example: | |
-------------- |
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
module FactoryGirlHelper | |
def find_or_create(*args) | |
name = args.shift | |
clazz = nil | |
# convert from underscores String to camelcase Class | |
if name.is_a? Hash | |
name = name.first[0] | |
clazz = name.first[1].to_s.camelize.constantize |
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
## http://stackoverflow.com/questions/7145256 | |
module FactoryGirl | |
module Strategy | |
class Find | |
def association(runner) | |
runner.run | |
end | |
def result(evaluation) | |
build_class(evaluation).where(get_overrides(evaluation)).first |
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
Ctrl+A |
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
matchdata = "121,32 Std.".match(/([\d]+[\,|\.]?\d{0,2})+\s?(\w.*)?/) | |
matchdata[1] # => "121,32" | |
matchdata[2] # => "Std." | |
matchdata[0] # => "121,32 Std." |
NewerOlder