I wrote this four years ago, so instead use this command:
$ docker rmi $(docker images -q -f dangling=true)
import Ember from 'ember'; | |
const { computed: { alias }, observer } = Ember | |
export default Ember.Component.extend({ | |
routing: Ember.inject.service('-routing'), | |
params: alias('routing.router.currentState.routerJsState.fullQueryParams') | |
}) |
// go on you labels pages | |
// eg https://github.com/cssnext/cssnext/labels | |
// paste this script in your console | |
// copy the output and now you can import it using https://github.com/popomore/github-labels ! | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), |
var request = require('supertest-as-promised'), | |
Promise = require('bluebird'), | |
should = require('should'); | |
var game = require('../game.js').app; | |
// Instead of assertScoreEquals, we now fetch the score | |
// and assert when the promise returns a value | |
var getScore = function() { | |
return request(game).get('/score').expect(200) |
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
/** | |
* Animation on hover (right way) | |
*/ | |
div { | |
width: 9em; | |
padding: .6em 1em; | |
margin: 2em auto; | |
background: yellowgreen; | |
animation: spin 1s linear infinite; |
// Q sample by Jeff Cogswell | |
/*=========== | |
We want to call these three functions in sequence, one after the other: | |
First we want to call one, which initiates an ajax call. Once that | |
ajax call is complete, we want to call two. Once two's ajax call is | |
complete, we want to call three. | |
BUT, we don't want to just call our three functions in sequence, as this quick |
A future version of Ember will come with a new templating engine known as HTMLBars.
The original motivation for HTMLBars was to allow helpers and properties to have better contextual information about what they were bound to.
So for example, consider a template like this:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
angular.module('setRepeat',[]).directive('setRepeat', function () { | |
return { | |
transclude: 'element', | |
priority: 1000, | |
compile: compileFun | |
}; | |
function compileFun(element, attrs, linker) { | |
var expression = attrs.setRepeat.split(' in '); |