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
import { expect } from 'chai'; | |
describe('Bad test when awaiting google Suite', () => { | |
beforeEach(async () => { | |
await browser.url('https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=bit-bundler'); | |
}); | |
describe('Getting all results container', () => { | |
var resultWithId, resultText; |
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
function streamChain(seed) { | |
var accumulator = []; | |
var streamFacade = { | |
write: function() { | |
throw new TypeError("This is not a stream. Please call sequence or parallel to get a stream out of this."); | |
}, | |
pipe: function(stream) { | |
if (!seed) { | |
seed = stream; |
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 stream = require("stream"); | |
var inherits = require("util").inherits; | |
function thru(chunk, encoding, handler) { | |
handler.next(chunk); | |
} | |
function handlerWrapper(next) { | |
return { | |
next: function(chunk) { |
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
function keypath(input) { | |
var regex = /(\w+)|\[([^\]]+)\]/g; | |
var result = []; | |
var path; | |
while ((path = regex.exec(input || ''))) { | |
if (input[path.index] === '[') { | |
result.push(path[2]); | |
} | |
else { |
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 fs = require("fs"); | |
var mkdirp = require("mkdirp"); | |
var path = require("path"); | |
var chance = require("chance"); | |
function fileStream(dest) { | |
mkdirp.sync(path.dirname(dest)); | |
return fs.createWriteStream(dest); | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 fs = require("fs"); | |
var mkdirp = require("mkdirp"); | |
var path = require("path"); | |
function fileStream(dest) { | |
mkdirp.sync(path.dirname(dest)); | |
return fs.createWriteStream(dest); | |
} | |
var writableStream = fileStream("./somecontent.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
function loadScript(url) { | |
var head = document.getElementsByTagName("head")[0] || document.documentElement; | |
var script = document.createElement("script"); | |
script.setAttribute("async", "true"); | |
script.setAttribute("charset", "utf-8"); | |
script.setAttribute("type", "text/javascript"); | |
script.setAttribute("src", url); | |
// |
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
function configureOptionArray(config) { | |
var result = []; | |
if (config) { | |
if (!Array.isArray(config)) { | |
result.push(config); | |
} | |
else { | |
result = result.concat(config); | |
} |
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
// | |
// http://24ways.org/2013/grunt-is-not-weird-and-hard/ | |
// | |
module.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
var sassybits = require("sassy-bits"); | |
var babelbits = require("babel-bits"); | |
var jsBundler = require("bit-bundler-browserpack"); |