Skip to content

Instantly share code, notes, and snippets.


Colten Jackson jazzyjackson

View GitHub Profile
View elementary.ts
import {ELElement, ELHTMLComment, ELHTMLStyleElement, ELHTMLElement, ELCSSStyleDeclaration, ELCSSStyleSheet} from "./schemas/elementary"
* Elementary has to decide what to do based on the data structure passd to it
* An array is recursed over, an object is made into an HTMLElement or an HTMLStyleELement
* Null is turned into a blank string, bool, numbers and strings are returned as strings.
function elementary(el: ELElement | ELElement[]) : string
View Gemetria.mathematica
GemetriaTable = AssociationThread[
Range[1, 9, 1],
Range[10, 90, 10],
Range[100, 400, 100]
Unfinalize = { "ם" -> "מ", "ן" -> "נ", "ץ" -> "צ", "ף" -> "פ", "ך" -> "כ" , "." -> ""}
View class.js
class CodemirrorBlock extends TextareaBlock {
this.defaultCodeMirror = {
lineNumbers: true,
// if whitespace value is "wrap" set lineWrapping to true, else lineWrapping is false (default)
lineWrapping: this.getAttribute('whitespace') == 'wrap',
if [[ $1 =~ '^python=[0-9.]+$' ]]
pythonversion=$1 # else if there's 2 arguments, use the first as python version
pythonscript=$2 # and second as path of python script
pyargs="${@:3}" # any remaining arguments will be passed to python
pythonversion="python=3.6" # if there's only one argument default to python 3.6
pythonscript=$1 # and use first argument as python script
pyargs=$"${@:2}" # any remaining arguments will be passed to python
View kvetch.js
/* - Public Domain software by Colten Jackson
* - make a global method to prefer over 'fetch' api
* - pass an object to convert key:value pairs to a properly encoded querystring (k:v, hence, kvetch)
* - use a Proxy with a getter so you can call 'kvetch.get()','kvetch.put()','kvetch.delete()' and so on with a single function
* * */
let kv2query = kv => Object.keys(kv || {}).map(key => {
var value = kv[key]
return encodeURIComponent(key) + '=' + encodeURIComponent(value)
View kvetch-example.html
<!-- an example of using the kvetch function -->
<!-- -->
<script src="wherever you cloned this file/kvetch.js">
kvetch.get('/', {anything: 'you want'})
// becomes '/?anything=you%20want''/somedata', null, {
"key-1" : "some data you want to send as a JSON body",
"key-b" : "the headers and cookies and everything else are handled for you"
View expand.js
// // edit this first line and call it whatever you want. overwrite document.createElement for all I car.
// // actually maybe that will be a nice upgrade. grab original createElement for safe keeping. if type is string, just call createElement. But I'll keep the two separate for now, and call mixint.createElement to be verbose that I'm doing something different
window.expand = function(graph){
if(!graph) throw new Error("You didn't give me a graph to work with")
// document.createElement can handle a string just fine you don't need me.
if(graph.constructor == String) return document.createElement(graph)
// otherwise let's recurse the graph and create some nodes
let [ tagName, attrObj ] = Object.entries(graph)[0]
let node = document.createElement(tagName)
// references to childNodes will be created in every node's .child property
#!/usr/bin/env python
# must be run with pyvalidate in PYTHONPATH
# condavision uses PYTHONPATH to check dependencies
import pandas,numpy
import StringIO, time
import pyvalidate
valid = pyvalidate.parameters({
"rows": {
# Python 2.7
from ConfigParser import *
import os, re, sys, json, io, atexit
import boto3
import time, datetime, traceback
def dictFromConfig(filepath):
config = ConfigParser()
return {section.lower(): dict(config.items(section)) for section in config.sections()}
View GitHub-Shortcode-HotFix.css
.gist tr {
display: flex;
.gist .blob-num {
/* widen the gutter to fit triple digits */
width: 2.5em !important;
.gist .blob-num::before {