This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| """I'm using ctypes to interact with cairo instead of pycairo | |
| because pycairo hasn't been updated in 4 years and has features missing | |
| in python3. | |
| """ | |
| import ctypes | |
| import ctypes.util | |
| from ctypes import c_void_p, c_double | |
| # Enumerate pixel formats | |
| FORMAT_INVALID = -1 |
This file contains hidden or 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
| import numpy | |
| import math | |
| def perspective(fovy, aspect, z_near, z_far): | |
| f = 1 / math.tan(math.radians(fovy) / 2) | |
| return numpy.array([[f / aspect, 0, 0, 0], | |
| [ 0, f, 0, 0], | |
| [ 0, 0, (z_far + z_near) / (z_near - z_far), -1], | |
| [ 0, 0, (2*z_far*z_near) / (z_near - z_far), 0]]) |
This file contains hidden or 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 __future__ import division | |
| from OpenGL.GL import * | |
| import numpy as np | |
| import math | |
| import pygame | |
| import textwrap | |
| from PIL import Image | |
| vertex_shader_source = textwrap.dedent("""\ |
This file contains hidden or 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
| <?php | |
| // Data like one might recieve from a form | |
| $data = [ | |
| 'id' => [ | |
| 10, | |
| 20, | |
| 100, | |
| ], | |
| 'first_name' => [ | |
| "Nick", |