Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Route.extend({
goToElement(selector, offset, target) {
if (selector == null) {
return;
}
offset = offset != null ? offset : staticConstants.headerHeight;
import handyMethods from 'handy-methods';
describe('handyMethods', function() {
describe('methodB', function() {
it("delegates to methodA", function() {
let methodAStub = sinon.stub(handyMethods, 'methodB');
methodAStub.returns('not foo');
expect(methodB('bar')).to.equal('not foo');
})
})
@ronco
ronco / controllers.application.js
Last active August 29, 2015 14:26
Reset Route Namespaces
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@ronco
ronco / mirage-helpers.js
Created July 10, 2015 17:44
Override mirage server endpoints helper
let defaultMap = {};
function getPathMap(verb) {
let verbPaths = defaultMap[verb];
if (!verbPaths) {
verbPaths = {};
defaultMap[verb] = verbPaths;
}
return verbPaths;
}
@ronco
ronco / application-controller.coffee
Last active August 29, 2015 14:11
Ember Widgets Modal custom actions
App.ApplicationController = Ember.Controller.extend
actions:
showModal: ->
Ember.Widgets.ModalComponent.popup
targetObject: this
contentViewClass: 'App.SampleModalContentView'
confirm: "modalConfirm"
cancel: "modalCancel"
maybeAction: "modalMaybe"

Keybase proof

I hereby claim:

  • I am ronco on github.
  • I am ronco (https://keybase.io/ronco) on keybase.
  • I have a public key whose fingerprint is 0FA5 867E E967 6648 9948 BBFB 09A9 DD2D CD1C F06E

To claim this, I am signing this object: