- Do not try to return properties from controllers, return the whole object.
- Eg: If you want to read a property of the first object of hasMany: do not return elements.firstObject.property. The hasMany are lazily loaded, thus not visible for models/controllers! The correct way is this: return the firstObject as computed property(elements.@each) and in the view bind the property. This way when the collection is lazy loaded, the view is notified and will update.
- Caution with collections in computed properties. You can observe the collection pointer or the collection elements(using @each)! They are different. Observing the collection pointer will notify when the collection is replaced or deleted, but not when an item is added! For this, you need to use @each.
- Displaying multiple model type on the same page is done with render(you can do it also with outlets but less clean).
- Observing a collection in order to apply a JQuery plugin is done using a CollectionView with a function observing content. In t
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
# Common configuration. | |
AllCops: | |
# Include gemspec and Rakefile | |
Include: | |
- '**/*.gemspec' | |
- '**/*.podspec' | |
- '**/*.jbuilder' | |
- '**/*.rake' | |
- '**/*.opal' | |
- '**/Gemfile' |
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
--- ext/readline/readline.c 2014-04-17 11:27:45.000000000 +0200 | |
+++ ext/readline/readline.c 2014-04-17 11:27:57.000000000 +0200 | |
@@ -1886,7 +1886,7 @@ | |
rl_attempted_completion_function = readline_attempted_completion_function; | |
#if defined(HAVE_RL_PRE_INPUT_HOOK) | |
- rl_pre_input_hook = (Function *)readline_pre_input_hook; | |
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook; | |
#endif | |
#ifdef HAVE_RL_CATCH_SIGNALS |
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
$ diff <(heroku config -s -r staging | cut -f1 -d "=") <(heroku config -s -r production | cut -f1 -d "=") |
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
* open the console | |
* sublime.log_commands(True) | |
* profit | |
Credits: | |
http://stackoverflow.com/a/11837792 |
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
string.gsub(/[^\x00-\x7F]/) { |non_ascii| "\\u#{"%4.4x" % non_ascii.ord}" } |
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
pp caller.drop_while {|e| e[/ruby-debug|\(eval\)|debugger|\<internal:prelude\>/] } |