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 random(a, b) { | |
if(Array.isArray(a)){ | |
return a[random(a.length)]; | |
} | |
if (typeof a === "object") { | |
var key = random(Object.keys(a)); | |
return b === "key" ? key : b === "both" ? {key:key,value:a[key]} : a[key]; | |
} | |
if (typeof a === "string" && !!a) { | |
return (a.toLowerCase() === "bool") ? (Math.floor(Math.random()*2) == 1) : random(a.split('')); |
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 SymetricEncryption(chars) { | |
var self = this; | |
self.alphabet = chars || "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*()_+-=`~[]\\{}|;':\",./<>? "; | |
function gc(pos) { | |
pos = pos % self.alphabet.length; | |
return self.alphabet[pos >= 0 ? pos : pos + self.alphabet.length]; | |
} |
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 RollingCypher() { | |
var chars = " qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*()_+-=[]\\{}|;':\",./<>?`~\t\r\n"; | |
chars = chars.concat(chars.concat(chars)); | |
function encrypt(s, p) { | |
var o = ""; | |
s = s.split(''); | |
p = p.split(''); | |
for (var i = 0; i < s.length; i++) { | |
o += chars[chars.indexOf(s[i]) + chars.indexOf(p[i % p.length])]; |
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 generateFormDOMElement(name, action, method, fields) { | |
var form = document.createElement("form"); | |
form.name = name; | |
form.action = action; | |
form.method = method; | |
for (var name in fields) { | |
var attributes = fields[name]; | |
var field = document.createElement("input"); | |
field.id = name; | |
field.name = name; |
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
.form-control { | |
padding: 8px; | |
margin: 5px; | |
width: 200px; | |
border: solid; | |
border-radius: 5px; | |
border-width: 1px; | |
border-color: #ccc; | |
box-shadow: inset 0px 0px 2px #ccc; | |
} |
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 value of input element | |
// SYNTAX: $IN.elementID | |
var username = $IN.username(); | |
// Listen for when the value changes | |
$IN.username.observe(function(value){ | |
console.log("value changed to:" + value); | |
}); |
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
age 6: decides to become an inventor | |
age 7: makes a 10-year plan to start a real estate company | |
age 8: realizes it won't happen in 10 years | |
age 9: designs an unrealistic solution for self-sustainable energy | |
age 10: gets a financial freedom certification and starts investing in the stocks | |
age 11: writes a report on how video games are made | |
age 12: builds over 40 video games | |
age 13: gets an internship as a game developer | |
age 14: learns how to make websites |
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
----------------------------------------------------------- | |
LICENSE AND COPYRIGHT | |
----------------------------------------------------------- | |
Your use of this software is governed by the following | |
conditions. Please read this before you install the program. | |
By using this software you are agreeing to the following | |
conditions: | |
This software is copyrighted and may not be modified or | |
included with another product without the express, written |
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
/* example use: | |
// pass JSON string or object | |
JSON_to_HTML([ | |
{ | |
tagName: "div", | |
id: "main", | |
children: [ | |
{ | |
tagName: "h1", | |
id: "mainTitle", |
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
Show hidden characters
{ | |
"presets": ["@babel/preset-env"] | |
} |