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
Show hidden characters
| [ | |
| { | |
| "class": "tabset_control", | |
| "tab_height": 32 | |
| } | |
| ] |
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
| def valid_email?(email) | |
| email =~ /^(|(([a-z0-9]+_+)|([a-z0-9]+\-+)|([a-z0-9]+\.+)|([a-z0-9]+))*[a-z0-9]+@([a-z0-9]{1})(([a-z0-9]+\-+)|([a-z0-9]+\.))*[a-z0-9\-\.]{1,62}\.[a-z]{2,6})$/i | |
| 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
| git config --global color.ui true |
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
| [ClassName].each do |object| | |
| puts "#{object.name} (" | |
| puts "\t# associations" | |
| reflections = object.reflect_on_all_associations | |
| reflections.each do |reflection| | |
| puts "\t#{reflection.macro} => #{reflection.name.to_s.classify}" | |
| end | |
| puts "" | |
| puts "\t# attributes" | |
| object.new.attributes.each do |attribute| |
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
| my_model = MyModel.find(:first) | |
| my_model.changed? # it will return false | |
| # You can Track changes to attributes with my_model.name_changed? accessor | |
| my_model.name # returns "Name" | |
| my_model.name = "New Name" | |
| my_model.name_changed? # returns true | |
| # Access previous value with name_was accessor | |
| my_model.name_was # "Name" |
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
| class AlphabeticalService | |
| def go! | |
| method_a | |
| method_b | |
| end | |
| private | |
| def method_a | |
| return if method_e? | |
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
| class FirstOccuranceService | |
| def go! | |
| method_a | |
| method_b | |
| end | |
| private | |
| def method_a | |
| return if method_e? | |
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
| class LastOccuranceService | |
| def go! | |
| method_a | |
| method_b | |
| end | |
| private | |
| def method_a | |
| return if method_e? | |
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
| git init | |
| git status | |
| svn mkdir --parents https://url.com/repo/trunk -m "Creating trunk" | |
| git svn init https://url.com/repo -s | |
| git svn fetch | |
| git status | |
| git branch -r | |
| git svn rebase | |
| git svn dcommit -n | |
| git add -i |
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
| <?php namespace Tmb; | |
| use Illuminate\Database\Eloquent\Model as Eloquent; | |
| use Illuminate\Validation\Validator; | |
| class BaseModel extends Eloquent | |
| { | |
| /** | |
| * Error message bag |
OlderNewer