Skip to content

Instantly share code, notes, and snippets.

View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@wuarmin
wuarmin / controllers.application.js
Last active Nov 22, 2018
sort_by_asnc_relationship_property
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Videos'
});
View calendar-months.component.js
import Ember from 'ember';
import moment from 'moment';
function withLocale(locale, fn) {
let returnValue;
if (locale) {
let previousLocale = moment.locale();
moment.locale(locale);
returnValue = fn();
moment.locale(previousLocale);
View components.calendar-months.js
import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from '../../templates/components/power-calendar/months';
import { scheduleOnce } from '@ember/runloop';
import { A as emberA } from '@ember/array';
import moment from 'moment';
function withLocale(locale, fn) {
let returnValue;
if(locale) {
View application.html
<img src="{{root-url}}assets/images/Logo_400x100.png">
View ember-simple-auth.js
import ENV from '../config/environment';
import Configuration from 'ember-simple-auth/configuration';
import setupSession from 'ember-simple-auth/initializers/setup-session';
import setupSessionService from 'ember-simple-auth/initializers/setup-session-service';
export default {
name: 'ember-simple-auth',
initialize(registry) {
const config = ENV['ember-simple-auth'] || {};
@wuarmin
wuarmin / service_interface.rb
Last active May 10, 2017
Minitest/Spec Sharing Examples / Check if class implements the interface
View service_interface.rb
module ServiceInterface
def self.included(base)
base.send :include, InstanceMethods
end
module InstanceMethods
def test
"test"
end
end
View components.my-tag-component.js
import Ember from 'ember';
export default Ember.Component.extend({
label: 'new tag',
type: '',
actions: {
add() {
let label = this.get('label');
let type = this.get('type');
@wuarmin
wuarmin / controllers.application.js
Last active Aug 16, 2016
inline if-conditional
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
prompt: 'Choose something...',
disablePrompt: true
});