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
| /+ Found in an old backup. I'm almost scared of what I was doing here... +/ | |
| import std.stdio; | |
| import std.string; | |
| import dlfcn; | |
| import std.c.posix.posix; | |
| import std.c.stdio; | |
| /+ |
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
| #!/bin/sh | |
| # Somewhat more convenient than grepping UnicodeData.txt directly. | |
| UnicodeData="${HOME}/.local/share/UnicodeData.txt" | |
| join() { | |
| joiner="$1"; shift | |
| output="$1"; shift | |
| for arg in "$@"; do | |
| output="$output$joiner$arg" |
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 | |
| import unicodedata, sys | |
| def uninamenum(c): | |
| u = 'U+%04X' % ord(c) | |
| try: | |
| name = unicodedata.name(c) | |
| except: | |
| return u |
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/perl -w | |
| use strict; | |
| =head | |
| Split up a big .sql file into mutiple pieces for each table represented, | |
| and fix things along the way. | |
| ASSUMPTIONS: | |
| 1. All SQL is uppercase | |
| 2. Table initialization on a line beginning with CREATE TABLE tablename | |
| 3. Closing paren/semicolon after CREATE TABLE on a line by itself |
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
| Impulse Tracker uses a weird font based on CP437, but with custom glyphs in | |
| positions 0x80 through 0xC9. This is an attempt to map these glyphs to a | |
| Unicode private use area in a somewhat rational manner (i.e. grouping related | |
| characters within 16-character blocks). | |
| I chose the block from U+E830 to U+E87F, which corresponds to the ConScript | |
| block for Deseret (or rather, what *was* Deseret prior to its inclusion in the | |
| Unicode standard as of version 3.1). I am not aware of any other significant | |
| use cases for characters in this range. In theory, there is room for 16 more | |
| characters, since Deseret extends to U+E88F, but that much space isn't needed. |
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/perl -w | |
| use strict; | |
| my @a = map { chop; split "," } <>; | |
| printf("XTerm*color%d: #%02x%02x%02x", $_, $a[$_], $a[$_ + 16], $a[$_ + 32]) for 0 ... 15; |
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 | |
| # Scrape Twitter's API documentation and pound it into SQLite CREATE TABLE statements. | |
| # | |
| # Give this URLs to the documentation pages you're interested in, e.g.: | |
| # $ python twitter-api-doc-to-sql.py https://dev.twitter.com/overview/api/tweets > tweets.sql | |
| # | |
| # It's always a good idea to review the output before making use of it. | |
| import re, sys, urllib.request, lxml.html, posixpath |
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/python | |
| import inspect | |
| class let(): | |
| def __init__(self, **k): | |
| self.k = k | |
| def __enter__(self): | |
| locs = self.framelocs = inspect.stack()[1][0].f_locals | |
| self.oldlocs = locs.copy() | |
| locs.update(self.k) |
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 code | |
| import os | |
| import threading | |
| from gi.repository import Gtk, GLib | |
| class ThreadedConsole(code.InteractiveConsole): | |
| # Set this to True to read $PYTHONSTARTUP. | |
| # This could potentially be a security risk (since it just exec's what |
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
| #!/bin/sh | |
| # I always felt 'make' ought to do this. | |
| # Search parent directories until Makefile is found, and build there. | |
| # All options are passed directly to make, with a possible -C if none exists. | |
| # (If -C or -f are given on the command line, no searching is done.) | |
| dir="." | |
| findparents=true |
NewerOlder