Skip to content

Instantly share code, notes, and snippets.

View jamesona's full-sized avatar

Jameson Aranda jamesona

View GitHub Profile
View calendar.js
This class defines a calendar factory.
Pass a dom node as an argument for the draw() method, to insert a
calendar as a child of the passed node (this replaces the node's contents).
Constructor parameters are month, year, and optional day data.
Valid JSON data is constructed as key-pairs of "mm/dd/yyyy: value"
{ ...
mm/dd/yyyy: value,
mm/dd/yyyy: value,
View modal.js
This is a modal class that creates a js object containing:
- a parent div, to use for things like dimming the page behind the dialog
- a title H1 containing whatever is passed as the title argument
- a body div containing whatever is passed as the body argument
A callback function will fire when the html is ready, if passed as a third argument.
Built-in methods:
- destroy() removes the dialog from the dom; takes no arguments
- attach() injects html model into the document; accepts a target node as argument;
View prompt.js
var Prompt = function(prompt){
var box = document.createElement('textarea');
box.placeholder = prompt; = "30vw"; = "60vh"; = "20vh"; = "35vw"; = "fixed"; = "0"; = "0";
View date_extremes.js
var getBeginningDate = function(period, date){
var date = (date === undefined ? new Date() : new Date(date));
if (period) {
period = period.toLowerCase();
switch (period) {
case 'year':
case 'quarter':
if (date.getMonth() >= 9) {
View xkcd replacements
//set 1
"witnesses": "thse dudes I don't know",
"allegedly": "kinda probably",
"new study": "tumblr post",
"rebuild": "avenge",
"space": "spaaaace",
"google glass": "virtual boy",
"smartphone": "pokedex",
"electric": "atomic",
View rainbowify_messenger.js
var h = 0;setInterval(function(){document.querySelectorAll('.clearfix._nd_.direction_ltr.text_align_ltr .clearfix div').forEach(function(e,i,a){ = "hsl("+h+", 83%, 44%)"
if (h < 359)
h = 0
}, 100)
View chessclock.html
<!doctype html>
<link href='' rel='stylesheet' type='text/css'>
<script src=""></script>
* {
font-family: 'Nixie One', sans-serif;
color: #E41B21;
body, html {
View gist:8cbfe412edf20c7c9ac6988b61402f85
Austin: "Is Andrew's brother-in-law not getting hired then? Oh wait, no, it was his wife's brother, wasn't it? Oh wait... That's the same thing..."
Jameson: "Are we going to finish by the end of the day?" (In regards to a ~30 minute task, with 2 hours left in the day)
Jordan: "At the rate I'm going... No."
Matt: "Its time to decompose Kurt. Kurt, just lay down in the dirt for like, a long time."
Austin: "It looks great guys!"
Jordan: " looks awful..."
Austin: "Well, yeah, but"
View demo.html
.modal-container {
background: rgba(0,0,0,0.5);
display: block;
height: 100vh;
position: absolute;
left: 0;
top: 0;