This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" NOTE: This is incomplete! | |
There are a lot of things that don't work, | |
like classes, generator functions and async functions! | |
""" | |
import ast | |
import itertools | |
import json | |
from io import StringIO | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
class Command(object): | |
name = None | |
aliases = [] | |
description = None | |
@classmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Attempts to screen-shot a element onto a canvas */ | |
var css = function(el, styles){ | |
for (var style in styles) { | |
if(!styles.hasOwnProperty(style)) continue; | |
el.style[style] = styles[style]; | |
} | |
return el; | |
}; | |
var selectElement = function(callback){ | |
var selection = document.createElement("div"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zip = function() { | |
var result = []; | |
// Only zip array-like items | |
var args = Array.prototype.filter.call(arguments, function(el){ | |
//Make sure the argument is array-like | |
return typeof el.length !== "undefined"; | |
}); | |
//if we have no items to reduce then return an empty array | |
if(args.length === 0) return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: main.c | |
gcc -o main main.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from xml.dom.minidom import parseString | |
import sys | |
import re | |
"""DISCLAIMER: I wrote this in like 30 minutes, its really hacky and a proof of concept""" | |
get_pairs = lambda i,l=2:map(None, *[iter(i)]*l) | |
coord_add = lambda l, r: l + r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Compile with `gcc -o anagram main.c -std=c99` | |
**/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
typedef struct { | |
char *human_readable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Pack.cpp | |
// | |
// Created by Nick Beeuwsaert on 5/17/14. | |
// Copyright (c) 2014 Nick Beeuwsaert. | |
// MIT Licensed. | |
// | |
#include "Pack.h" | |
#include <stdarg.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIBS=`sdl2-config --libs` `pkg-config SDL2_image --libs` | |
CFLAGS=`sdl2-config --cflags` `pkg-config SDL2_image --cflags` | |
all: main.o | |
gcc -o main main.o $(LIBS) -Wall | |
main.o: main.c | |
gcc -o main.o -c main.c $(CFLAGS) -Wall | |
clean: | |
rm main.o main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* NOTE: Because Chrome doesn't elevate the permissions | |
* of snippets, we can't push the image out to the browser | |
* using canvas.toDataURL(), we have to add it to the page | |
* and have the user right-click and save-as | |
*/ | |
var css = function(el, styles){ | |
for (var style in styles) { | |
if(!styles.hasOwnProperty(style)) continue; | |
el.style[style] = styles[style]; |