Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan rondale-sc

View GitHub Profile
View show.js
model(params) {
let shoebox = this.get('fastboot.shoebox');
let shoeboxStore = shoebox.retrieve('my-store');
if (this.get('fastboot.isFastBoot')) {
return this.store.queryRecord('episode', { slug: params.slug }).then(episode => {
if(!shoeboxStore){
shoeboxStore = {};
shoebox.put('my-store', shoeboxStore);
}
View ember-bootstrap-email-base-styles.css
.mail-box {
border-collapse: collapse;
border-spacing: 0;
display: table;
table-layout: fixed;
width: 100%;
}
.mail-box aside {
display: table-cell;
float: none;
View config.js
import Ember from 'ember';
const { get } = Ember;
export default function() {
this.namespace = 'api/v1';
this.get('/emails', function({emails}, request) {
const folderName = request.queryParams.folderName;
View module-for-acceptance-with-register.js
import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
// BugFix: Can be removed after 2.1. If resolver is set then fallback doesn't happen properly
View module-for-acceptance-with-register
import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { assertionInjector, assertionCleanup } from '../assertions';
export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
assertionInjector(this.application);
View show-note.js
model(params){
return Ember.RSVP.hash({
people: this.store.findAll('person'),
resources: this.store.findAll('resource'),
model: this.modelFor('episode.edit').get('showNotes').findBy('id', params.showNoteId)
});
},
setupController(controller, hash) {
controller.setProperties(hash);
View ja-ruby.rb
require 'json_api_client'
module MyApi
# this is an "abstract" base class that
class Base < JsonApiClient::Resource
# set the api base url in an abstract base class
self.site = "http://localhost:4000/api"
end
class Episode < Base
View emberweekend-two-ex.js
// Run inside console to speed up Emberweekend playback by 2x
// Warning! MEgaHAxors!
source = EmberWeekend.__container__.lookup('service:player').get('audio')._audio
source.playbackRate = 2
View ja-ruby.rb
require 'json_api_client'
module MyApi
# this is an "abstract" base class that
class Base < JsonApiClient::Resource
# set the api base url in an abstract base class
self.site = "http://127.0.0.1:4000/api"
end
class Episode < Base
View application.js
import Ember from 'ember';
import ActiveModelSerializer from 'ember-cli-mirage/serializers/active-model-serializer'
import { pluralize } from 'ember-inflector';
const { camelize, dasherize } = Ember.String;
export default ActiveModelSerializer.extend({
keyForModel(type) {
return camelize(type);