This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** IT WAS RELATED TO THEM AT ANTIUKUS THUSLY, THAT THE REBELS WOULD SUCCEED IN THEIR ERANDS IF THEY SPOKE THEIR COMMITMENT | |
** TO MOOOL. AND MOOOL REACHED OUT A POWERFUL HAND OF JUDGEMENT AND TOUCHED THEIR LEADER SO THAT HE SPOKE IN TONGUES AND | |
** HE SPOKE AS A PROPHET AND EXTOLED THE VIRTUE OF MOOOL. AND IT WAS SO THAT THE REBELS SPOKE THEIR ALLEGIANCE TO MOOOL AND | |
** CAME TO THE BATTLEFIELD CHANTING HIS NAME, WITH SWORD AND SPEAR IN HAND AGAINST THE GREAT WALLS OF THEIR ENEMIES, AND IT | |
** WAS AS MOOOL HAD SAID, THAT WITH HIS NAME IN THEIR MOUTHS THEIR ENEMIES WOULD BE JUDGED, AND THE REBELS CAME UPON THEIR | |
** OPRESSORS WITH GREAT POWER AND FORCE, AND FELLED THE WALLS AND ALL THE BUILDINGS IN THE GREAT CITIES THAT THEY HAD BUILT | |
** AND IT WAS WITH A SWIFT HAND THAT THEIR KINGS WERE BROUGHT TO ACCOUNT, AND THEIR FALSE TEMPLES RAISED, AND THEIR FIELDS | |
** BURNT AND SALTED. AND SO IN VICTORY THE REBELS ERECTED A STATUE IN THE CITY DEDICATED TO MOOOL, AND CREATED THE STATUE | |
** IN HIS IMAGE, WITH MIGHT AND JUD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$_GET = (function() { | |
let x = {}; | |
(decodeURI(window.location.search).replace("?","").split("&")||[]).forEach(el=>{ | |
let ab = el.split("="); | |
if(ab[0].slice(-2) == "[]") { | |
ab[0]=ab[0].replace("[]",""); | |
if(!Array.isArray(x[ab[0]])){ x[ab[0]] = []; } | |
x[ab[0]].push(ab[1]); | |
} | |
else { x[ab[0]] = ab[1] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlBuilder(param,val,url=window.location.href) { | |
return url.indexOf(param+"=") != -1 ? String(url).replace(new RegExp(param + "=[^&]+","ig"),param+"="+val) : url + "&" + param + "=" + val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCartContents(callback = function(){}) { | |
fetch("/cart.js").then(function(el){return (el.json());}).then(function(cart) { | |
console.log(cart); | |
callback(cart); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Instance(obj) { | |
let nobj={}; | |
for(let prop in obj) { | |
let val = obj[prop]; | |
if(typeof val === "number") { nobj[prop] = Number(val); } | |
if(typeof val === "string") { nobj[prop] = String(val); } | |
if(typeof val === "function") { nobj[prop] = val; } | |
if(typeof val === "object") { | |
if(Array.isArray(val)) { | |
nobj[prop]=[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
def main(): | |
print("\npyleon 0.1 - Yet more dumb software by Ben Ehrlich (benergize.com)") | |
print("Let's Rock and Roll") | |
print("----------------------------\n") | |
if len(sys.argv) < 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function csvToJSON(csv, textDelimiter = '"', fieldDelimiter = ",", logging = false) { | |
//Split it by every character | |
let f=csv.split(""); | |
//Track whether or not we're in a quote block right now | |
let inQuote = -1; | |
//Array to store all of the separated values | |
let vals = [[]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monthObject = { | |
"January":31, | |
"February":28, | |
"March":31, | |
"April":30, | |
"May":31, | |
"June":30, | |
"July":31, | |
"August":31, | |
"September":30, |