Skip to content

Instantly share code, notes, and snippets.

View stuartpb's full-sized avatar

Stuart P. Bentley stuartpb

View GitHub Profile
@stuartpb
stuartpb / glorw.txt
Created June 4, 2013 22:43
General list of reserved words
### General List of Reserved Words
### Stuart P. Bentley <stuart@testtrack4.com>, June 4, 2013
## This is a general list of words you may want to consider reserving,
## in a system where users can pick any name, in a context where the
## system may use names as well. One prominent example of a system
## where this is the case would be a site that serves pages for users,
## at their username, from the site root, like
## http://twitter.com/stuartpb . In this system, you would want to
## reserve some routes for pages that would commonly be expected to
@stuartpb
stuartpb / redirect.md
Created January 31, 2011 14:20
A page of combined documentation for SDL_ScanCode and SDLKey.
#! /home/stuserbot/bin/lua
local rt = {}
local getenv = os.getenv
local strupper = string.upper
local strlower = string.lower
local format = string.format
local gsub = string.gsub
local setmetatable = setmetatable
local write = io.write

Lost from https://blogs.msdn.microsoft.com/ericgu/2004/01/12/minus-100-points/

When I switched over the C# compiler team, I had hoped that I would be able to give some insight into how the design team works, what decisions we make, etc. Language design is a very esoteric field, and there's not a lot written about it (though “Design and evolution of C++“ is a pretty good read). I had hoped that I would be able to do this with concrete examples, as that makes it much easier.

I've been watching for candidate topics to write about, but haven't yet come up with any good ones. One of the problems is that features have a tendency to morph in design (and in whether they'll make it into Whidbey) as time goes by, and it would be bad for me to say, “we're talking about doing“ and then have us decide it wasn't a good idea. Or, for us to decide that doesn't fit into our schedule, or it would break existing code, or any of the other reasons that might cause us to pull a feature. We're generally not comfortable re

Lost from https://blogs.msdn.microsoft.com/ericgu/2004/01/12/minus-100-points/

When I switched over the C# compiler team, I had hoped that I would be able to give some insight into how the design team works, what decisions we make, etc. Language design is a very esoteric field, and there's not a lot written about it (though “Design and evolution of C++“ is a pretty good read). I had hoped that I would be able to do this with concrete examples, as that makes it much easier.

I've been watching for candidate topics to write about, but haven't yet come up with any good ones. One of the problems is that features have a tendency to morph in design (and in whether they'll make it into Whidbey) as time goes by, and it would be bad for me to say, “we're talking about doing“ and then have us decide it wasn't a good idea. Or, for us to decide that doesn't fit into our schedule, or it would break existing code, or any of the other reasons that might cause us to pull a feature. We're generally not comfortable re

@stuartpb
stuartpb / example.lua
Last active December 14, 2021 18:11
Lua script for fancy named parameters with default values
local fp = require "fancyparams"
myfunction = fp(
{{"a"},{"b",7},{"c",5}},
function(a, b, c)
print(a, b, c)
end
)
@stuartpb
stuartpb / simplifyMLZPath.js
Last active May 5, 2020 21:08
JavaScript to simplify uniform SVG paths
// run on http://mourner.github.io/simplify-js/
var tolerance = 5;
function simplifyMLZPath(path) {
var polys = JSON.parse('[['+path
.replace(/[LM](\d+(?:\.\d+)?),(\d+(?:\.\d+)?)/g,'{"x":$1,"y":$2},')
.replace(/,Z/g,'],[')
.slice(0,-2)+']');
var segments = [];
@stuartpb
stuartpb / statement.md
Last active November 16, 2019 03:33
David Holmes opening statement

STATEMENT OF

DAVID A. HOLMES
U.S. EMBASSY KYIV, DEPARTMENT OF STATE

BEFORE THE

/tmp/.mount_Slic3rC132Lw/usr/bin/slic3r.wrapper: line 125: 32119 Aborted (core dumped) LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2> /dev/null
/tmp/.mount_Slic3rC132Lw/usr/bin/slic3r.wrapper: line 125: 32124 Aborted (core dumped) LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2> /dev/null
Creating main frame...
(slic3r.pl:32083): Gtk-CRITICAL **: 11:28:34.612: IA__gtk_color_button_set_color: assertion 'color != NULL' failed
** (slic3r.pl:32083): WARNING **: 11:28:34.869: Pixbuf theme: Cannot load pixmap file /usr/share/themes/Adwaita/gtk-2.0/assets/treeview-separator-ltr.png: Couldn’t recognize the image file format for file “/usr/share/themes/Adwaita/gtk-2.0/assets/treeview-separator-ltr.png”
(slic3r.pl:32083): GdkPixbuf-CRITICAL **: 11:28:34.869: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

Keybase proof

I hereby claim:

  • I am stuartpb on github.
  • I am stuartpb (https://keybase.io/stuartpb) on keybase.
  • I have a public key whose fingerprint is 03A0 8855 B413 1748 7D1E 6690 FF04 2AE3 ECE2 8BA9

To claim this, I am signing this object: