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 sys | |
outmode = 0 | |
mode = 0 | |
data = '' | |
def glify(name): | |
return 'GL' + name if name not in ('const', 'void') else name |
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/bash | |
# | |
# Attach reviewed-by etc tags to the latest commit. | |
# | |
set -e | |
progname=$(basename "$0") | |
function usage () { |
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
# Python impl of the new gen4/5 clip shader algorithm, | |
# to explore it in a a slightly easier form than GEN assembly. | |
# just some simple 4-wide vector instructions | |
def swiz4(x, a, b, c, d): | |
return (x[a], x[b], x[c], x[d]) | |
def add4(x, y): | |
return (x[0] + y[0], x[1] + y[1], x[2] + y[2], x[3] + y[3]) | |
def neg4(x): | |
return (-x[0], -x[1], -x[2], -x[3]) |
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/bash | |
set -e | |
mkdir -p raw out | |
rm raw/GL3.txt | |
wget -cO raw/GL3.txt http://cgit.freedesktop.org/mesa/mesa/plain/docs/GL3.txt | |
sed -i 's!\(GL_\)\?\(ARB\|NV\|AMD\|EXT\|KHR\|GLX\)_\([^ )]\+\)!<a href="http://www.opengl.org/registry/specs/\2/\3.txt">\0</a>!g' raw/GL3.txt | |
cat > raw/preamble << EOT | |
<!doctype html> |
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
@water: #004466; | |
Map { background-color: @water; } | |
#base-coastline, #islands { polygon-fill: #ccc; } | |
#rivers, #lakes { polygon-fill: @water; } | |
#roads { ::a { line-color: #ccc; line-width: 2.5px } | |
line-color: #888; } | |
#roads[hway_num != ''] { ::a { line-width: 3.5px; } | |
line-width: 2.5px; } |
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 yaml | |
>>> import urllib2 | |
>>> content = urllib2.urlopen('http://master.open-ra.org/list.php').read() | |
>>> y = yaml.load(content.replace('\t',' ')) | |
>>> print y | |
{'Game@0': {'Map': '700c39e1f70c06ee7a9dd119720234c3132231a0', 'Mods': 'ra', 'Name': 'OpenRA', 'Address': '82.124.81.35:1234', 'Players': 1, 'State': 2, 'TTL': 195, 'Id': 202253}, 'Game@1': {'Map': 'f9ce9066950638c1b10e9d2d34071a4adacb8071', 'Mods': 'ra@playtest-20110904', 'Name': 'not down', 'Address': '174.52.251.86:1234', 'Players': 6, 'State': 1, 'TTL': 299, 'Id': 202278}} | |
>>> y['Game@0']['Map'] | |
'700c39e1f70c06ee7a9dd119720234c3132231a0' |
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 python2 | |
"""A really simple IRC bot.""" | |
import sys | |
from twisted.internet import reactor, protocol | |
from twisted.words.protocols import irc | |
class Bot(irc.IRCClient): | |
def _get_nickname(self): |
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
// format80 roundtrip | |
var bytes = new List<byte>(); | |
for (var q = 0; q < 4096; q++) | |
bytes.Add((byte)q); | |
var src = bytes.ToArray(); | |
var encoded = Format80.Encode(src); | |
var decoded = new byte[src.Length]; | |
if (Format80.DecodeInto(encoded, decoded) != src.Length) | |
throw new InvalidOperationException("Bogus length"); |
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
using System.Drawing; | |
namespace fontgen | |
{ | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var bitmap = new Bitmap(1024, 60); | |
var x = 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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
namespace wctest | |
{ | |
static class Program |