Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['category', 'term'],
category: 0,
term: 0,
actions: {
increment(qp) {
let routeArgument = {};
import Ember from 'ember';
function makeIterable(someObject) {
someObject[Symbol.iterator] = function() {
let nextIndex = 0;
return {
next: function() {
if (nextIndex < someObject.order.length) {
return { value: someObject[someObject.order[nextIndex++]], done: false };
@nathanhammond
nathanhammond / hide-post-see-less.js
Created June 12, 2017 17:36
Hide Post, See Less
/**
* You can navigate the Facebook feed interface using `j` and `k`.
* This script allows you to use the `x` key once focused on a story
* to hide a post and see less from its author to train Facebook's model
* as to whether you'll be interested in a particular piece of content.
* Install it as either a UserScript or bookmarklet.
*
* License: MIT
*/
function seeLess() {
@nathanhammond
nathanhammond / router.js
Last active April 25, 2017 17:38
Route Transition Error
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('standalone');
@nathanhammond
nathanhammond / router.js
Last active April 8, 2017 21:25
New Twiddle
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('standalone');
import Ember from 'ember';
let i = 0;
export default Ember.Controller.extend({
foo: function(event) {
console.log(++i, this, event);
},
actions: {
thing: function(event) {
@nathanhammond
nathanhammond / router.js
Last active October 7, 2016 07:20
New Twiddle
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('login', {path: '/'});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@nathanhammond
nathanhammond / rollup-funnel.js
Last active February 11, 2024 23:00
Funnel which includes only the modules identified by rollup.
var path = require('path');
var Funnel = require('broccoli-funnel');
var Plugin = require('broccoli-plugin');
var rollup = require('rollup').rollup;
var amdNameResolver = require('amd-name-resolver').moduleResolve;
var existsSync = require('exists-sync');
// Create a subclass RollupFunnel derived from Plugin
RollupFunnel.prototype = Object.create(Plugin.prototype);
RollupFunnel.prototype.constructor = RollupFunnel;