Skip to content

Instantly share code, notes, and snippets.

View jazzyjackson's full-sized avatar

Colten Jackson jazzyjackson

View GitHub Profile
GemetriaTable = AssociationThread[
Alphabet["Hebrew"],
Join[
Range[1, 9, 1],
Range[10, 90, 10],
Range[100, 400, 100]
]
]
Unfinalize = { "ם" -> "מ", "ן" -> "נ", "ץ" -> "צ", "ף" -> "פ", "ך" -> "כ" , "." -> ""}
class CodemirrorBlock extends TextareaBlock {
constructor(props){
super(props)
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.]+$' ]]
then
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
else
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
fi
/* - 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
* * */
(function(){
let kv2query = kv => Object.keys(kv || {}).map(key => {
var value = kv[key]
return encodeURIComponent(key) + '=' + encodeURIComponent(value)
}).join('&')
<!-- an example of using the kvetch function -->
<!-- https://github.com/jazzyjackson/kvetch.js -->
<script src="wherever you cloned this file/kvetch.js">
<script>
kvetch.get('/', {anything: 'you want'})
// becomes '/?anything=you%20want'
kvetch.post('/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"
// // 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": {
"type":"number::int",
# Python 2.7
from ConfigParser import *
import os, re, sys, json, io, atexit
import boto3
import time, datetime, traceback
def dictFromConfig(filepath):
config = ConfigParser()
config.read(filepath)
return {section.lower(): dict(config.items(section)) for section in config.sections()}
.gist tr {
display: flex;
}
.gist .blob-num {
/* widen the gutter to fit triple digits */
width: 2.5em !important;
}
.gist .blob-num::before {
Object.prototype.is = function(that){
return Object.is(this.valueOf(), that.valueOf())
}