This file contains 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
alias ssl_rails='sudo pkill nginx && rvmsudo nginx -c ~/Workspace/SCEA/painfree/community/config/nginx.conf.dev' |
This file contains 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
newColumn: -> | |
# NOPE! | |
# @get('newColumns').pushObject { title: @get('targetColumn'), type: @get('selectedNewColumn.id') } | |
_arr = @get('newColumns') | |
_arr.pushObject { title: @get('targetColumn'), type: @get('selectedNewColumn.id') } | |
@set('newColumns', _arr) |
This file contains 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
// I want to nullify segment_id for the model before saving if it was not changed; | |
// is it okay to mess with _dirtyAttributes ? | |
actions: { | |
updateParticipant: function() { | |
if (!this.get('model._dirtyAttributes').contains('segment_id')) { | |
this.get('model').set('segment_id', null); | |
} | |
return this.get('model').save().then(function() { | |
return console.log("NOTIFY THE USER!"); |
This file contains 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
this.get('model').save().then(function() { | |
return console.log("OK"); | |
}).catch(function() { | |
return console.log("KO"); | |
}); |
This file contains 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
# A very basic en-us inflector that relies on the UI programmer | |
# to provide the (optional) plural version of the irregular noun | |
# | |
# pluralize 3 'Friend' | |
# => Friends | |
# pluralize 0 'Octopus' 'Octopodes' | |
# => Octopodes | |
Ember.Handlebars.registerBoundHelper 'pluralize', (count, singular, plural) -> | |
plural = singular + 's' if typeof(plural) == 'object' |
This file contains 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 Annotation object has labels, but only carries the list of label values | |
// "labels":["terr","anno"] | |
// This is the form of the full annotationLabel | |
// {"id":1,"label":"Terrifying","value":"terr"} | |
// {"id":2,"label":"Annoying","value":"anno"} | |
This file contains 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
Processing by Api::Admin::MarkerActivitiesController#create as JSON | |
Parameters: {"title"=>"THIS IS OKAY", "description"=>"default description", "social_is_active"=>true, "social_description"=>"default description", "labels_is_active"=>true, "labels_description"=>"default description", "label_data"=>"[FILTERED]", "sentiment_is_active"=>true, "sentiment_description"=>"default description", "image_attachment"=>{"name"=>"Screen Shot 2014-06-20 at 12.47.55 PM.png", "type"=>"image/png", "data"=>"[FILTERED]"}, "api_version"=>"v1", "project_id"=>"3078", "marker_activity"=>{}} |
This file contains 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
// in the component's didInsertElement | |
$(window).on('resize', function() { | |
return Em.run.debounce(that, 'resizeWindow', 250); | |
}); | |
// in the route's willTransition | |
$(window).off('resize'); |
This file contains 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
for TABLE in $(psql table_name -c "\dt" | awk '{print $3}'); do psql table_name -c "select '$TABLE', count(*) from $TABLE;" | grep -A1 "\-\-\-\-" | tail -1; done |
This file contains 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
// MomentJS can use different types of timezone offset | |
// including the one obtained by ActiveSupport::TimeZone | |
var timezone_offset = "+01:00"; | |
console.log(moment().zone(timezone_offset).format('LLLL')); | |
> Tuesday, October 28 2014 7:51 PM | |
console.log(moment().format('LLLL')); |
OlderNewer