Skip to content

Instantly share code, notes, and snippets.

@rstudner
rstudner / code
Last active August 29, 2015 14:01
import {request, raw} from 'ic-ajax';
var ApplicationRoute = Ember.Route.extend({
beforeModel: function() {
},
model: function () {
return new Ember.RSVP.Promise(function (resolve, reject) {
var promise = new Ember.RSVP.Promise(function (p1Resolve, reject) {
request({
@rstudner
rstudner / gist:5ad410d71a077b357e1e
Created February 1, 2015 16:23
This can't be the right way :)
var ActivityRow = React.createClass({
render: function() {
return (
<div className="activity-row">
<span className="activity-time-stamp">{this.props.activity.timestamp}</span>
<p>{this.props.activity.title}</p>
<p className="activity-detail">{this.props.activity.detail}</p>
</div>
)
}
@rstudner
rstudner / helpers.average.js
Last active October 31, 2016 15:12 — forked from toranb/helpers.average.js
EmberReduxYelpClone
import Ember from 'ember';
export default Ember.Helper.helper(function(params) {
var reviews = params[0] || [];
var total = reviews.map((review) => {
return review.rating;
}).reduce((prev, next) => {
return prev + next;
});
var fullStars = Math.floor(total / reviews.length);
import DS from "ember-data";
export default DS.JSONAPIAdapter.extend();
@rstudner
rstudner / controllers.application.js
Created January 3, 2017 13:29 — forked from machty/controllers.application.js
ember-concurrency starter
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myTask: task(function * () {
let didConfirm = yield this.get('getConfirmation').perform("Are you sure?");
if (didConfirm) {
alert("woot");
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
test('Check if totals device view is ok', async t => {
const devices = await monitoredDevicesSection.find('.card');
//await t.expect(devices.count).ok();
const numberOfIndividualDevices = await devices.count;
console.log(numberOfIndividualDevices);
});