I hereby claim:
- I am nsfmc on github.
- I am nsfmc (https://keybase.io/nsfmc) on keybase.
- I have a public key whose fingerprint is 55CF 0365 F98C 2904 200A 7034 22D2 16D1 9B7C 45A7
To claim this, I am signing this object:
import argparse | |
import random | |
def dicenumber(): | |
"""return a 5-digit number suitable for diceware | |
the 5-digit integer contains only the digits 1-6 | |
""" | |
return int(''.join([str(random.randrange(1, 7)) for x in range(5)])) |
I hereby claim:
To claim this, I am signing this object:
<!-- one image | |
you could imagine, for example, | |
icon.svg#tiny referring to an icon for display on 3x3" display | |
icon.svg#small referring to an icon on a portrait-oriented phone | |
icon.svg#default referring to an icon that will be large enough to resolve all detail | |
--> | |
<picture> | |
<source media="(max-width: 12em)" src="icon.svg#tiny"> | |
<source media="(max-width: 24em)" src="icon.svg#small"> |
A Pen by Marcos Ojeda on CodePen.
/** | |
* returns a new buffer with toggled endianness | |
* @param {Buffer} buff a nodeJS buffer, presumably utf16le/ucs2 | |
* @return {Buffer} a nodeJS buffer, probably utf16be | |
*/ | |
function toggleEndian(buff){ | |
out = [] | |
for (var i = 0; i < buff.length; i+=2) { | |
out[i] = buff[i + 1]; | |
out[i + 1] = buff[i]; |
""" | |
ka design automation tools - | |
super rough, but this is a set of functions, documented at the bottom, | |
which let you get the text/names of topics/subjects/domains for parts of | |
our topic tree. | |
you need to get the topic tree, which you can do by running | |
curl -o ~/topictree.json http://www.khanacademy.org/api/v1/topictree | |
A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
# getting relative size of each subject in math using | |
# http://www.khanacademy.org/api/v1/topictree and helper | |
# methods from https://gist.github.com/nsfmc/2a877c61f0f7da984ead | |
# to plug into something like https://gist.github.com/nsfmc/2d496c1bb9e096402f8e | |
output = [] | |
for s in subjects_for_domain('math'): | |
count = 0 | |
for t in get_topics(domain='math', subject=s['slug']): | |
for tut in t['children']: |
from ka_automation import * | |
# yeesh, gross!!! | |
def random_domain_color(slug, **kwargs): | |
import random | |
seed = kwargs.get('seed', 53) | |
print seed | |
random.seed(seed) | |
subject_count = len(subjects_for_domain(slug)) |