Skip to content

Instantly share code, notes, and snippets.

View MiguelCastillo's full-sized avatar

Miguel Castillo MiguelCastillo

View GitHub Profile
[22:00:13] Using gulpfile ~//gulpfile.js
[22:00:13] Starting 'selenium'...
[22:00:15] Finished 'selenium' after 1.55 s
[22:00:15] Starting 'google'...
=======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================
[21:56:56] Using gulpfile ~//gulpfile.js
[21:56:56] Starting 'selenium'...
[21:56:58] Finished 'selenium' after 1.37 s
[21:56:58] Starting 'google'...
=======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================
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;
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;
@MiguelCastillo
MiguelCastillo / jquery-bootstrap-browserify.js
Created March 31, 2015 03:44
Adding require jquery to bootstrap via a browserify transform
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var through = require('through');
var libs = ['jquery', 'bootstrap'];
gulp.task('app-bundle', function() {
var appBundler = browserify(['./app.js']);
libs.forEach(function(lib) {
@MiguelCastillo
MiguelCastillo / xfrp.js
Last active August 25, 2016 17:01
stream frp
var stream = require("stream");
var inherits = require("util").inherits;
function thru(chunk, encoding, handler) {
handler.next(chunk);
}
function handlerWrapper(next) {
return {
next: function(chunk) {
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 {
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);
}
@MiguelCastillo
MiguelCastillo / 0_reuse_code.js
Created March 7, 2016 18:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
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");