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
#! /bin/bash | |
set -e | |
if ! git diff-index --quiet HEAD --; then | |
echo "ERROR: you have uncommited changes. Please stash or commit before running this script." | |
exit 1 | |
fi | |
git fetch |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['card-thingy'], | |
click() { | |
this.sendAction('transitionToMyRoute'); | |
} | |
}); |
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
# This patch is to work around this bug in Rails 5.0.x and 5.1.x | |
# https://github.com/rails/rails/issues/30947 | |
# Because we use SQLite for tests and MySQL in prod, having the options hash | |
# containing ENGINE=InnoDB causes problems when we try to prepare the test database. | |
# | |
# Because of this, we need to remove those options from the generated schema.rb file. | |
# Here is the source that's setting `options` | |
# https://github.com/rails/rails/blob/81787a895126ead62a2859b33eccbbb74ef38892/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb#L561 | |
# | |
# This should be removed for Rails 5.2 ++ |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
array: Ember.A([]), | |
setSomeStuff() { | |
this.get('array').pushObjects(['foo', 'bar', 'baz']); | |
} | |
}); |
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
import Ember from 'ember'; | |
import { task, timeout } from 'ember-concurrency'; | |
export default Ember.Component.extend({ | |
myVal: null, | |
asyncPoll: task(function * () { | |
console.log('polling'); | |
this.set('myVal', Math.random()); | |
yield timeout(1000); // ms | |
this.get('asyncPoll').perform(); // requeue myself |
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
# This class exists to make the caching of Foo objects more efficient. | |
# Marshaling full activerecord objects is expensive, especially in Rails 5 | |
# because of this bug: https://github.com/rails/rails/issues/30680 | |
# This simple ruby class selects a very small subset of parameters needed | |
# for common operations on these objects. It also acts like Foo, by | |
# passing attributes through to an in-memory Foo model. | |
class FooForCaching | |
attr_accessor :attributes | |
# This is a list of attributes we want to save in cache |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
import Ember from 'ember'; | |
import { validator, buildValidations } from 'ember-cp-validations'; | |
import { userInfoValidations } from '../models/order'; | |
const Validations = buildValidations(userInfoValidations); | |
export default Ember.Component.extend(Validations, { | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
NewerOlder