Skip to content

Instantly share code, notes, and snippets.

View dennishall1's full-sized avatar

Dennis Hall dennishall1

View GitHub Profile
// pass in either location.search or location.hash, taking care to remove the leading '?' or '#' first.
function getParams(str) {
return str.split("&").reduce(function(params, keyValuePair){
keyValuePair = keyValuePair.split('=');
params[decodeURIComponent(keyValuePair[0])] = decodeURIComponent(keyValuePair[1]);
return params;
}, {});
}
@dennishall1
dennishall1 / go-pipeline-poor-mans-notify.js
Last active June 14, 2018 14:05
go (lang) pipelines - browser alert when build is done
timer = setInterval(function(){
if(!document.querySelector('a.pipeline_stage[href*="vans-test-6"]').classList.contains('building')){
clearInterval(timer);
alert('done');
}
});
@dennishall1
dennishall1 / github show all outdated diff comments.js
Last active September 11, 2018 07:30
Show all outdated diff comments on a pull request in Github -- Simulate clicking on all links that say "Show outdated"
$$('.btn-link.text-gray').forEach(function(item){
if(item.innerHTML.match(/Show outdated/)){
item.dispatchEvent(new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
}));
}
});
@dennishall1
dennishall1 / split-svg-spritesheet.js
Created March 17, 2016 19:06
Split SVG Spritesheet into individual SVG files
var fs = require('fs');
var path = require('path');
var markup = fs.readFileSync('sprite.svg').toString();
var lines = markup.split(/\n/g);
var symbols = {};
var currentSymbol = null;