Skip to content

Instantly share code, notes, and snippets.

View timrwood's full-sized avatar

Tim Wood timrwood

View GitHub Profile
# NPM
# Remove local node modules
rm -rf node_modules/
# Remove npm shrinkwrap
rm npm-shrinkwrap.json
@timrwood
timrwood / qunit.js
Created December 2, 2013 18:26
qunit set favicon
if (config.stats.bad) {
setFavicon('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAH0lEQVQ4T2P8z8AAROQDxlEDGEbDgGE0DIBZaBikAwCl1B/x0/RuTAAAAABJRU5ErkJggg==');
} else {
setFavicon('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAHklEQVQ4T2Nk+A+EFADGUQMYRsOAYTQMgHloGKQDAJXkH/HZpKBrAAAAAElFTkSuQmCC');
}
function setFavicon( uri ) {
Ember.STRINGS = {
test : 'asdf'
};
Ember.Handlebars.helper('_', function(string) {
return Ember.String.loc(string);
});
body {
color: broken;
}
App.MyComponent = Ember.Component.extend({
startTimer: function () {
// start timer
}.on( 'didInsertElement' ),
killTimer: function () {
// stop timer
}.on( 'willDestroyElement' )
});
@timrwood
timrwood / tasks.js
Created January 9, 2014 03:37
Gulp task organization
gulp.task('qa') // jshint, jscs, tests
gulp.task('js') // require/browserify, concat, uglify
gulp.task('css') // stylus, autoprefixer, csso
gulp.task('img') // imagemin, copy, svgmin
gulp.task('html') // consolidate, htmlmin
gulp.task('font') // ??
gulp.task('sprite') // ??
gulp.task('build', ['qa', 'js', 'css', 'img', 'html'])
function () {
var last = null;
this.get('content').forEach(function (item) {
item.set('prev', last);
item.set('next', null);
if (last) {
last.set('next', item);
}
last = item;
});
alias fact="elinks -dump randomfunfacts.com | grep '|' -B 2 -A 2"
alias p='fact && git pull --rebase'
alias up='fact && git push'
@timrwood
timrwood / update.md
Created February 10, 2014 21:10
red-django 0.2.0 and red-static 0.2.1

Update red-django and red-static.

$ npm update -g generator-red-static generator-red-django

Or, install them if you hadn't done so yet.

test('Testing a component', function () {
var component = App.ExampleButtonComponent.create({
layoutName : 'components/example-button'
});
Ember.run(function () {
component.append();
});
equal(component.$('.is-not-enabled').length, 1, 'Should show the .is-not-enabled element');