Skip to content

Instantly share code, notes, and snippets.

View charlypoly's full-sized avatar
🚀
Building thriving devtools

Charly Poly charlypoly

🚀
Building thriving devtools
View GitHub Profile
@charlypoly
charlypoly / yaml_i18n_merge.rb
Last active November 5, 2015 15:07
Merge all yaml locale files into one by locale
# 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] }
@charlypoly
charlypoly / updateDirectiveIsolateScope.js
Created October 9, 2014 22:21
Angular testing: update directive isolate scope helper
function updateIsolateScope (element, data) {
var directiveScope = element.isolateScope();
directiveScope = angular.extend(directiveScope, data);
element.data('$isolateScope', directiveScope);
}
@charlypoly
charlypoly / angular.filters.nl2br.js
Last active August 29, 2015 14:06 — forked from naoyeye/angular.filters.nl2br.js
use strict compliant version + handle undefined case
/*
# Usage in html template:
"xxx | nl2br"
<div ng-bind-html=" YourString | nl2br "></div>
or:
@charlypoly
charlypoly / gist:5618929
Last active December 17, 2015 13:39
Top level Request error handler - Similar to $.ajaxError in JQuery Example with PHP exception print in JSON by the remote server.
/*
* Top level Request error handler
* - Similar to $.ajaxError in JQuery
*/
Class.refactor(Request, {
__refactor_default_onComplete : null,
initialize : function(options) {