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 spawn = require('child_process').spawn; | |
module.exports = function(grunt) { | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function (data) { | |
data = (data + '').trim().toLowerCase(); | |
if (data === "test") { |
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
<script> | |
// only load scripts if it's for desktop | |
if (Modernizr.mq('(min-width: 500px)')) { | |
Modernizr.load([ | |
{ | |
load: '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js', | |
complete: function () { | |
// only load jquery if the cdn version isn't available | |
if ( !window.jQuery ) { | |
Modernizr.load('scripts/lib/jquery.js'); |
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
/** | |
* Allows for chaining on an object. | |
* Functions will be able to be called normally, | |
* but all other types need to be accessed using | |
* `Chain.set(prop, val)` and `Chain.get(prop)` | |
* | |
* I haven't tested this in many browsers yet. | |
* Until then, it's probably safer to use something like | |
* LeaVerou's Chainvas | |
* http://leaverou.github.io/chainvas/ |
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
/** | |
* Creates a copy of a mutable object to a certain depth. | |
* Useful when nested obects need to be cloned, since _.clone only | |
* produces a shallow copy. | |
* | |
* NOTE: this function is overkill if you want to copy the whole thing without a depth limit. | |
* Alternatively, just stringify and parse the object like: | |
function deepClone (obj) { | |
return JSON.parse(JSON.stringify(obj)); |
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
let Foo = (function () { | |
let __secrets = new WeakMap(); | |
class Foo { | |
constructor () { | |
__secrets.set(this, Math.floor(Math.random()*100)); | |
} | |
get bar() { | |
return __secrets.get(this); | |
} |
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
# add folder to zip | |
> zip -r filename.zip directory/* |
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 Promise = require('bluebird') | |
, less = Promise.promisifyAll(require('less')) | |
, path = require('path') | |
, fs = require('fs') | |
, through = require('through2') | |
app.get('/node_modules/bootstrap/less/glyphicons.less', (req, res) => { | |
res.header("Content-type", "text/css"); | |
fs.createReadStream(path.join(__dirname, './node_modules/bootstrap/less/glyphicons.less')) |
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
[ignore] | |
<PROJECT_ROOT>/node_modules/material-ui/styles/withStyles.js.flow | |
<PROJECT_ROOT>/node_modules/react-scrollbar-size/node_modules/react-event-listener/.* | |
<PROJECT_ROOT>/node_modules/jss/lib/renderers/DomRenderer.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/ConditionalRule.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/FontFaceRule.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/KeyframesRule.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/StyleRule.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/ViewportRule.js.flow | |
<PROJECT_ROOT>/node_modules/jss/lib/rules/SimpleRule.js.flow |
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
const MARKER = '__jss-snapshot-serializer-marker__'; | |
const jssClassNameRegexp = /(^(?:[^-]+)-\w+)(?:(?:-\d+){1,2})/i; | |
const collectElements = (element, elements = []) => { | |
if (typeof element !== 'object') { | |
return elements; | |
} | |
elements.push(element); |