Instantly share code, notes, and snippets.

View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.js'></script>
<script src='lodash.min.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.css' rel='stylesheet' />
View fishcer-yates-shuffle.js
function shuffle(l) {
var plucked = [],
len = l.length;
while (plucked.length < len) {
var idx = parseInt(Math.random() * l.length);
plucked.push( l.splice(idx, 1)[0] );
}
return plucked;
}
View rotn.py
def rotn(s, n=13, f=97, l=122):
'''Rotate each char in `s` with codepoint between `f` and `l` by `n`'''
return ''.join([chr(((ord(c)-f+n) % (l-f+1))+f) if f<=ord(c)<=l else c for c in s.lower()])
a = rotn('I believe in a thing called love')
b = rotn(a)
print(a, b)
View .block
license: MIT
height: 348
scrolling: no
border: yes
View .block
license: MIT
height: 690
scrolling: no
border: yes
View convert.py
import json
l = {}
j = json.load(open('dance.json'))
for body_part in j:
l[body_part] = []
sub = []
for idx in j[body_part]:
val = j[body_part][idx]
View convert.py
import json
l = {}
j = json.load(open('dance.json'))
for body_part in j:
l[body_part] = []
sub = []
for idx in j[body_part]:
val = j[body_part][idx]