Skip to content

Instantly share code, notes, and snippets.

View jesgundy's full-sized avatar

Jesse Gundy jesgundy

View GitHub Profile
@jesgundy
jesgundy / gulpfile.js
Created June 3, 2020 20:32 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@jesgundy
jesgundy / lodashify.js
Created November 28, 2017 21:15
to import lodash into chrome dev tools console
var el = document.createElement('script');
el.src = "https://cdn.jsdelivr.net/lodash/4.11.1/lodash.min.js";
el.type = "text/javascript";
document.head.appendChild(el);
// Use the following in a bookmarklet:
javascript:var el=document.createElement('script');el.src="https://cdn.jsdelivr.net/lodash/4.11.1/lodash.min.js";el.type = "text/javascript";document.head.appendChild(el);
@jesgundy
jesgundy / google-analytics-amd.js
Created August 19, 2016 17:41 — forked from ismyrnow/google-analytics-amd.js
Google Analytics AMD Module
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
@jesgundy
jesgundy / autosave.js
Last active August 18, 2016 21:38 — forked from d3nj3ll/autosave.js
Client-side Autosave Using localStorage
// Retrieve the object from storage onReady
var autosave = localStorage.getItem('file');
// parses the string (btw. its UTF-8)
var text = JSON.parse(autosave);
//modifies the textarea with the id="inputTextArea"
$("textarea#inputTextArea").val(text);
// Autosave on keystroke works in offline mode