This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy: { | |
inplace: { | |
files: [{ | |
expand: true, | |
cwd: 'src', | |
src: '**/*.js', | |
dest: 'src' | |
}], | |
options: { | |
process: function(content, filepath) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Paste your Gruntfile (or important parts of it) here | |
* | |
*/ | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
watch: { | |
options: { | |
livereload: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
canvas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SourceMapConcatHelper.prototype._dummyNode = function(src, name) { | |
var node = new SourceNode(); | |
var lineIndex = 1; | |
var charIndex = 0; | |
// Tokenize on words, new lines, and white space. | |
var tokens = src.split(/(\n|\b)/g); | |
// Filter out empty strings. | |
tokens = tokens.filter(function(t) { return !!t; }); | |
// Reduce whitespace tokens together. | |
tokens = tokens.reduce(function(dest, t, index, src) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution to https://gist.github.com/jmeas/0a713e0b9901a25a32f1. | |
module.exports = function(start, increment) { | |
// Parse the date. | |
var d = new Date(start); | |
// Determine day of week. | |
var day = d.getUTCDay(); | |
// Determine sign. | |
var sign = Math.sign(increment); | |
var absIncrement = Math.abs(increment); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.Mixin.create({ | |
attributeBindings: ['style'], | |
concatenatedProperties: ['styleBindings'], | |
styleBindings: [], | |
_styleBoundValues: function() { | |
var values = Ember.ArrayProxy.create({content: []}); | |
this.get('styleBindings').map(function(key, index) { | |
var observer = function() { |
Welder exposes 3 major hooks and 1 minor one. Commands create a promise chain with the other 2 major hooks settle and reduce. Settle creates a hash of immutable data. Reduce operates in series on the same data. Settle and reduce are called with a name which expands by the command running it into a series of name sets to match against settle and reduce handles registered. If there are multiple handles registeredto the same matching name set, the minor hook, order, determines the sorting order of these handels.
command
: performs a set of settle and reduce hookssettle
: returns immutable data optionally cached, errors are okreduce
: operate on last value, error at the end is not ok, handlers can fix errorsorder
: used in settle and reduce to order multiple handles
'sync:graph'
- matches in the high level order, handles on the same match rely on a 'order' handle to sort them. default 'order' is to warn and sort by generated name, causing registration order to determine order.
- 'sync:graph:f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/initializers/helper.js | |
exports.name = 'helper'; | |
exports.initialize = function(container, app) { | |
Object.keys(app.HELPERS).forEach(function(key) { | |
Ember.Handlerbars.helper(key.replace(/\//g, '-'), app.HELPERS[key]); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mainLoop = Abacus.timer({ | |
callback: function( data ) { | |
data.delta // time since the last tick | |
data.ticks // zero indexed number of ticks | |
} | |
}); | |
// Start the timer with an optional kill time in miliseconds | |
// if no miliseconds are passed in, it wil run FOR EV AR, until you pause it | |
mainLoop.start( 10000 ) |
OlderNewer