Skip to content

Instantly share code, notes, and snippets.

@enkore
enkore / X1000.md
Created April 9, 2012 20:17
RFC X1000

Specification Formatting Conventions

Misc - Workgroup: 0x10c Standards Committee

Authors

This draft provides guidelines on formatting draft specifications for submission to the 0x10c standards committee. It is designed to loosely correlate with the formatting of RFCs.

@enkore
enkore / X1005.md
Created April 10, 2012 09:35
X1005

String Format

Lib - Workgroup: 0x10c Standards Committee

Authors

This document presents a general format for strings in libraries intended to be shared across programs and with other users.

_____ _____
/\ \ /\ \
/::\ \ /::\ \
/::::\ \ /::::\ \
/::::::\ \ /::::::\ \
/:::/\:::\ \ /:::/\:::\ \
/:::/__\:::\ \ /:::/ \:::\ \
\:::\ \:::\ \ /:::/ \:::\ \
___\:::\ \:::\ \ /:::/ / \:::\ \
/\ \:::\ \:::\ \ /:::/ / \:::\ \
  • l1
  • l2
  • l3

sdsadasdsa dasdsadsa dsadasdsa 32sad

sdas32regdsf

RFC X1001 - Assembly Relocation Table

Asm - Workgroup: 0x10c Standards Committee

Authors

This draft provides a formal structure for providing an assembly relocation table from within DCPU-16 programs.

@enkore
enkore / 0xSCA.xml
Created April 17, 2012 12:39
0xSCA/Rationale
<section title="Design Rationale">
<section title="Labels">
<t>Although Notch used the syntax :label in his first
examples, it is not common in any popular assembler.
Thus we decided for label: as the recommended form,
still silently allowing the deprecated form.</t>
<t>To simplify writing reusable code we also introduced
local labels, which are only visible from within the
global label they are defined within. Implementing this
is easy to do and introduces little overhead, as nesting
@enkore
enkore / form.py
Created April 21, 2012 14:54
Generic AJAX forms in Django
class BasicDialogForm(object):
dialog = {
"title": _("NOT SET"),
"text": "",
"submit": {
"text": _("Save changes"),
"active": _("Saving..."),
"color": "btn-primary",
},
"id": "some-value",
@enkore
enkore / gist:2512070
Created April 27, 2012 19:28
Ctrl+A (Select All) with edit controls without ES_MULTILINE
LRESULT CALLBACK EditWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_KEYDOWN:
switch(wParam) {
case 'A': // Ctrl+A = select all
if(GetKeyState(VK_CONTROL) & 0x8000) {
SendMessage(hWnd, EM_SETSEL, 0, -1);
}
break;
@enkore
enkore / avr_netio.py
Created May 19, 2012 17:50
Controlling the AVR Net-IO board in Python
# DSLRlapse
# AVR Net-IO plugin
# Copyright (C) 2011 Marian Beermann
# Copyright (C) 2012 Marian Beermann
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@enkore
enkore / proxy.py
Created May 20, 2012 10:53
DynamicProxy
class DynamicProxy(object):
class Task(object):
fn = None
args = list()
kwargs = dict()
def __init__(self, target, target_proxy=None):
self._target = target
self._methods = inspect.getmembers(target, inspect.ismethod)
print "Methods: %s" % self._methods