Skip to content

Instantly share code, notes, and snippets.

@myjpa
myjpa / ember-migration-utils
Last active August 29, 2015 14:23
ember migrations utils and pattern
# now can try this:
# https://github.com/abuiles/ember-watson
# this command replaces all '#each x in y' with '#each y as |x|' under current folder and subfolders
grep -R '#each' * -l | xargs -n1 perl -pi -w -e 's/#each ([\w.]+) in ([\w.]+)/#each $2 as |$1|/g'
@myjpa
myjpa / Ember.DebouncedTextField.coffee
Last active November 26, 2020 07:18
Debounced Ember TextField
# monkey patching Ember.TextField so that you can add delay=500 to make the
# TextField to update the binding value in debounced manner with delay of 500ms.
# That is it will only update the value if there is a unsubmitted change and
# no user input for the specified delay period.
# While no delay spcified, it's just the plain Ember.TextField
# usage in handlebars:
# {{view Ember.TextField valueBinding="someValue" delay=500}}
Ember.TextField.reopen {
delay: null # delayed period for updating the binding value in ms
_debouncedSet: (key,value,delay)->Ember.run.debounce(this, Ember.set, this, key, value, delay)
@myjpa
myjpa / .screenrc
Created March 30, 2012 09:10
sample .screenrc
# Color table:
# 0 Black . leave color unchanged
# 1 Red b blue
# 2 Green c cyan
# 3 Brown / yellow d default color
# 4 Blue g green b bold
# 5 Purple k blacK B blinking
# 6 Cyan m magenta d dim
# 7 White r red r reverse
# 8 unused/illegal w white s standout