Skip to content

Instantly share code, notes, and snippets.

View olitomas's full-sized avatar
🎯
Focusing

Óli Tómas olitomas

🎯
Focusing
  • Repeat.is, Orkuskipting.is, Fjáröflun.is, Skildingur, Kaffiklúbburinn
  • Iceland
View GitHub Profile
@olitomas
olitomas / parseUrl.js
Created July 4, 2016 00:04 — forked from cmatskas/parseUrl.js
ParseUrl.js
var parseQueryString = function(url) {
var urlParams = {};
url.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) {
urlParams[$1] = $3;
}
);
return urlParams;
//This is a comment
function cssAnimationEvent(element, type, callback) {
var self = this;
var pfx = ["webkit", "moz", "MS", "o", ""];
for (var p = 0; p < pfx.length; p++) {
if (!pfx[p]) type = type.toLowerCase();
element.addEventListener(pfx[p]+type, function() {
callback(element);
}, false);
}