Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
import config from 'minutebase/config/environment';
export default Ember.Component.extend({
classNames: "google-static-map",
tagName: "img",
attributeBindings: ["src"],
width: Ember.computed(function() {
return this.element && this.$().width();
@jgwhite
jgwhite / select.hbs
Last active August 29, 2015 14:23 — forked from ef4/select.hbs
<select onchange={{action "someAction" "firstArg" (pluck-attr "value") path.to.third.arg}}>
{{#each vehicles key="@item" as |vehicleChoice|}}
<option value={{vehicleChoice}} selected={{eq vehicle vehicleChoice}}>{{vehicleChoice}}</option>
{{/each}}
</select>
{{#turbo-list as |group|}}
{{#each items as |item|}}
{{#sortable-item model=item group=group}}
{{item.name}}
{{/sortable-item}}
{{/each}}
{{/turbo-list}}
test('changing masthead via drop', function() {
dropFiles('.masthead .drop-zone', [{ name: 'test.svg' }]);
andThen(function() {
ok(exists('.masthead img[src="http://assets.example.com/test.svg"]'),
'expected masthead image to update');
});
});
import Ember from 'ember';
const { $ } = Ember;
/**
Reorders elements to the specified state.
Examples
reorder(
'fz-forecast-manager',
--- tests/acceptance/create-homework-test.js
+++ tests/acceptance/create-homework-test.js
@@ -1,16 +1,14 @@
test('Creating a new homework', function(assert) {
visit('/homeworks/new');
- andThen(function() {
- const title = 'Underwater basket weaving';
- const description = 'an amazing the description about basket weaving';
+ const title = 'Underwater basket weaving';
module Foo
def self.included(base)
base.include Baz
end
end
module Baz
def hello
"Hi there!"
end
import Ember from 'ember';
const { computed, inject } = Ember;
export default Ember.Service.extend({
store: inject.service(),
isPending: computed.readOnly('all.isPending'),
all: computed('store', function() {
let store = this.get('store');
return store.find('activity');
@jgwhite
jgwhite / _versions_.js
Created February 12, 2015 14:31
ember.js/master build failures
{ ember: '1.12.0-beta.1+canary',
npm: '2.5.1',
ares: '1.9.0-DEV',
http_parser: '1.0',
modules: '11',
node: '0.10.36',
openssl: '1.0.1l',
phantomjs: '1.9.8',
uv: '0.10.30',
v8: '3.14.5.9',
def permute(list)
list # => ["a", "b", "c", "d"], ["b", "c", "d"], ["c", "d"]
head, *tail = list
head # => "a", "b", "c"
tail # => ["b", "c", "d"], ["c", "d"], ["d"]
if tail.count == 1
[[head, tail[0]], [tail[0], head]]
else
tp = permute(tail)