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
App.Forms.ImageUploader = Ember.View.extend | |
classNames: ['ember-image-uploader'] | |
controller: null | |
didInsertElement: -> | |
controller = @get('controller') | |
if controller.get('imageUploadUrl') | |
@initUploader() | |
else | |
@get('controller').addObserver 'imageUploadUrl', => | |
if @get('controller.imageUploadUrl') |
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
App.Router = Em.Router.extend({ | |
root: Em.Route.extend({ | |
route: '/', | |
user: Em.Route.extend({ | |
route: '/:user_id/', | |
connectOutlets: function (router, context) { | |
//What is context here? | |
// it's simple in the one segment case where | |
// its the return value of find on the model. | |
}, |
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
namespace :rubber do | |
namespace :pdf do | |
after "rubber:install_packages", "rubber:pdf:install_wkhtmltopdf" | |
desc "install wkhtmltopdf see http://stackoverflow.com/questions/9672070/wicked-pdf-on-production-server/9687535#9687535 for details" | |
task :install_wkhtmltopdf, roles: :app do | |
sudo_script 'install_wkhtmltopdf', <<-ENDSCRIPT | |
if ! which wkhtmltopdf &> /dev/null; then | |
apt-get install -y wkhtmltopdf | |
apt-get remove -y wkhtmltopdf --purge |
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
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js | |
var BoundHelperView = Ember._MetamorphView.extend({ | |
context: null, | |
options: null, | |
property: null, | |
// paths of the property that are also observed | |
propertyPaths: [], | |
value: Ember.K, |
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
App.ObjectWatcher = Ember.Object.create({ | |
methodCounter: 0, | |
observeOnce: function(object, property, callback) { | |
var aroundCallbackName, callbackName; | |
callbackName = "_method" + (this.methodCounter++); | |
aroundCallbackName = callbackName.slice(1); | |
this[callbackName] = callback; | |
this[aroundCallbackName] = function() { | |
this[callbackName](); | |
object.removeObserver(property, this, aroundCallbackName); |
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
# Add a key binding to your User Key Bindings and you're all good to go | |
# { "keys": ["super+shift+h"], "command": "convert_hex_to_rgb" } | |
# | |
import sublime, sublime_plugin | |
class ConvertHexToRgb(sublime_plugin.TextCommand): | |
def run(self, edit): | |
for region in self.view.sel(): | |
if not region.empty(): |
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
require 'oauth2' | |
require 'foursquare2' | |
class FoursquareBot | |
BURGER_FUEL_PARNELL_ID = "4b3992a0f964a520d05d25e3" | |
attr_accessor :client | |
def initialize(token) | |
@client = Foursquare2::Client.new(:oauth_token => token) | |
end |
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
# config/initializers/extensions/active_record.rb | |
module ActiveRecord | |
class Base | |
class << self | |
delegate :pluck, to: :scoped | |
end | |
end | |
class CollectionProxy | |
delegate :pluck, to: :scoped |
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
src_files: | |
- public/javascripts/lib/jquery/jquery.js | |
# jammit_packages | |
# | |
# See jasmine_config.rb | |
jammit_packages: | |
- head | |
- common |