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
module PrettyParseError ( | |
prettyParseError, | |
PrettyParseErrorOptions(PrettyParseErrorOptions), | |
prettyParseErrorDefaults | |
) where | |
import Data.List (intercalate, nub) | |
import Text.Parsec | |
import Text.Parsec.Error | |
import Text.Parsec.Pos |
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
import sys | |
import usb.core | |
import usb.util | |
import time | |
def initialize(): | |
# find our device | |
dev = usb.core.find(idVendor=0x1a86, idProduct=0x7584) |
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
/* | |
MESA=<path to git clone of git://anongit.freedesktop.org/mesa/mesa> | |
gcc | |
-I$MESA/include/ | |
-I$MESA/src/ | |
-I$MESA/src/mesa | |
-I$MESA/src/mapi | |
-I$MESA/src/gallium/include | |
-lglapi |
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
while ! ./_/build.sh 2> _/build.log; do | |
if [[ $(grep "No such file or directory" _/build.log) =~ .*error..(.*)..No.such.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding file" $missing | |
mkdir -p $(dirname _missing/$missing) | |
touch _missing/$missing | |
elif [[ $(grep "was not declared in this scope" _/build.log) =~ .*error..‘([A-Z0-9_]*)’.was.not.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding constant" $missing |
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
# RFC 7159 § 9 | |
# "An implementation may set limits on the size of texts that it accepts." | |
def parse_json(text): | |
if len(text) != 1: | |
raise ValueError("Only accepts single character JSON values") | |
return int(text[0]) |
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
""" | |
Usage: python3 regional.py list of words | |
Prints a representation of the words as Regional Identifiers, and copies the output directly to keyboard for you | |
This is because some terminals think that zero width spaces are silly. | |
Currently supports: A-Z | |
Requires: Python 3 | |
Now less complex, thanks @bmispelon! | |
""" |
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
#include <exception> | |
#include <functional> | |
#ifdef __EMSCRIPTEN__ | |
#include <emscripten.h> | |
#include <SDL.h> | |
#include <SDL_image.h> | |
#include <SDL_ttf.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
// TODO: longer method name | |
Function.prototype.extractBlockCommentAsMultilineString = function() { | |
return this.toString().match(/^function \(\)\{\s*\/\*((?:[^*]|\*+[^*\/])*)\*+\/\s*\}$/)[1]; | |
}; | |
var s = function(){/* | |
STRING | |
GOES | |
HERE | |
*/}.extractBlockCommentAsMultilineString(); |
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
function pulse(node, time) { | |
if (!node) throw new Error("node was falsy"); | |
if (node.constructor && node.constructor == NodeList) { | |
var nodes = Array.prototype.slice.call(node); | |
nodes.forEach(function (node) { pulse(node, time); }); | |
return; | |
} | |
if (!node.style) return; |
NewerOlder