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
AccountSerializer = ActiveModelSerializer.extend | |
attrs: | |
defaultPreferences: | |
serialize: false | |
subscribed: | |
serialize: false | |
cancelled: | |
serialize: false | |
defaultPreferences: | |
serialize: false |
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 recently upgraded my ember-cli app running on Ember 1.13.x to Ember 2.0.1. Here's how I did it: | |
1. I updated to Ember 1.13.10 by editing the bower.json file and then running bower update. | |
2. I fixed all Ember deprecation warnings. Some of the deprecation warnings were from my code while others were from external libraries that I was using. | |
3. To update to Ember 2.0.1 I did the following: | |
made the following changes to bower.json | |
- changed "ember": "1.13.10" to "ember": "2.0.1" | |
- changed "ember-data": "1.13.11" to "ember-data": "2.0.0" | |
- changed "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3" to "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.5" | |
- changed "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5" to "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.7" |
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
`import Ember from 'ember'` | |
SavedIndicatorComponent = Ember.Component.extend | |
_saveCount: 0 | |
attrs: | |
saveCount: 0 | |
duration: 2000 | |
attributeBindings: ['style'] |
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
`import DS from 'ember-data'` | |
ApplicationAdapter = DS.ActiveModelAdapter.extend | |
namespace: 'api/v1' | |
headers: | |
"X-CSRF-Token": $('meta[name="csrf-token"]').attr('content') | |
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
namespace :deploy | |
namespace :assets do | |
desc "precompile and sync assets to app servers" | |
task :sync do | |
on roles(:app), in: :parallel do |role| | |
run_locally do | |
execute "rsync -avr -e ssh ./public/assets/ #{role.username}@#{role.hostname}:#{release_path}/public/assets" | |
end | |
end | |
end |
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
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
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
var canvas = document.getElementById("myCanvas"); | |
var ctx = canvas.getContext("2d"); | |
var x = 0; | |
var y = 0; | |
function drawShape() { | |
ctx.fillRect(x, y, 150, 80); | |
} |
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.some_class').bind 'click', (e) -> | |
e.preventDefault(); | |
$.get $(this).attr('href'), (data) -> | |
$.fancybox | |
content: $(data).find('#main_content_wrapper') |
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
# Rather than going nuclear and downgrading Xcode or using some other big GCC installer, | |
# this worked for me... | |
# From https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb | |
# Path may vary slightly... | |
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 | |
# If you've attempted to install REE previously and it failed... |
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
require 'spec_helper' | |
def product_attributes | |
{ | |
:name => "Test Product", | |
:description => "hello world", | |
:sku => "my_sku", | |
:price => 100, | |
:on_hand => 10, | |
:deleted_at => nil, |
NewerOlder