Skip to content

Instantly share code, notes, and snippets.

View Jberivera's full-sized avatar

Juan Bernardo Rivera Arias Jberivera

View GitHub Profile
const browserify = require('browserify');
const gulp = require('gulp');
const rename = require('gulp-rename');
const runSequence = require('run-sequence');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
const gutil = require('gulp-util');
const del = require('del');
@Jberivera
Jberivera / nextTick.js
Created September 14, 2016 14:18 — forked from mmalecki/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@Jberivera
Jberivera / onlyNumbersAndComma.js
Last active August 29, 2015 14:14
This function makes that an input field only allows numbers and just one comma, below you'll find the anonymous function version
//this is the functional version of the same code allowing you work with several inputs
var onlyNumbers = function(){
'use strict';
var coma = true,
that = this;
this.addEventListener('keyup', function(e){
var key = e.keyCode,
value = that.value;
if(key == 8 && value.search(/,/) === -1){