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
# to run in a Rails console ! | |
def returning(value) | |
yield(value) | |
value | |
end | |
class Hash | |
def deep_reject_key!(key) | |
keys.each {|k| delete(k) if k == key || self[k] == self[key] } |
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
function updateIsolateScope (element, data) { | |
var directiveScope = element.isolateScope(); | |
directiveScope = angular.extend(directiveScope, data); | |
element.data('$isolateScope', directiveScope); | |
} |
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
/* | |
# Usage in html template: | |
"xxx | nl2br" | |
<div ng-bind-html=" YourString | nl2br "></div> | |
or: |
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
/* | |
* Top level Request error handler | |
* - Similar to $.ajaxError in JQuery | |
*/ | |
Class.refactor(Request, { | |
__refactor_default_onComplete : null, | |
initialize : function(options) { | |
NewerOlder