Skip to content

Instantly share code, notes, and snippets.

@migerh
migerh / inherit.js
Created February 18, 2013 20:01
javascript inheritance example
// This is a constructor that is used to setup inheritance without
// invoking the base's constructor. It does nothing, so it doesn't
// create properties on the prototype like our previous example did
function surrogateCtor() {}
function extend(base, sub) {
// Copy the prototype from the base to setup inheritance
surrogateCtor.prototype = base.prototype;
// Tricky huh?
sub.prototype = new surrogateCtor();
@migerh
migerh / snip.js
Last active December 11, 2015 04:58
var o, hl_obj, pos = [0, 0];
if (e[JXG.touchProperty]) {
pos = GUI.board.getMousePosition(e, 0);
} else {
pos = GUI.board.getMousePosition(e);
}
@migerh
migerh / CanvasRenderer.diff
Last active December 11, 2015 04:38
problem?
- for (i = i; i < len-1; i++) {
- if (!el.vertices[i].isReal) {
+
+ for (j = i; j < len - 1; j++) {
+ if (!el.vertices[j].isReal) {
@migerh
migerh / Text.diff
Created January 11, 2013 16:26
Diff of JXG.Text from 0.95 to 0.96 without whitespace changes
diff --git a/src/Text.js b/src/Text.js
index 9fafcd5..50b9fb9 100644
--- a/src/Text.js
+++ b/src/Text.js
@@ -42,7 +42,7 @@ JXG.Text = function (board, content, coords, attributes) {
var i;
- this.content = content;
+ this.content = '';
@migerh
migerh / map.py
Last active December 10, 2015 16:39 — forked from anonymous/map.py
#!/usr/bin/env python
import Image
import ImageDraw
import random
import math
import pyglet
import pyglet.gl as gl
import pyglet.window.key as key
@migerh
migerh / keyboard.dasm16
Created April 28, 2012 22:26
keyboard example
IAS isr
IAQ 1
SET A, 0
HWI 1
SET A, 3
SET B, 0x7
HWI 0
@migerh
migerh / dcpu_1.5_1.7.diff
Created April 27, 2012 12:19
1.5 to 1.7 diff
--- 1.5.txt 2012-04-27 14:18:27.253403562 +0200
+++ 1.7.txt 2012-04-27 14:18:23.201539323 +0200
@@ -1,6 +1,6 @@
DCPU-16 Specification
Copyright 1985 Mojang
-Version 1.5
+Version 1.7
@migerh
migerh / log
Created April 27, 2012 04:52
kernel asm error
[ 95%] Assembling openf.dasm16 with DCPU-Toolchain...
make[2]: *** [kernel/src/openf.o] Error 1
make[1]: *** [kernel/CMakeFiles/kernel.dir/all] Error 2
make: *** [all] Error 2
@migerh
migerh / dcpu
Created April 26, 2012 11:58
specs diff 1.4 to 1.5
--- dcpu16.txt 2012-04-26 13:57:37.477152465 +0200
+++ dcpu16_1_5.txt 2012-04-26 13:57:12.209965926 +0200
@@ -1,6 +1,6 @@
DCPU-16 Specification
Copyright 1985 Mojang
-Version 1.4
+Version 1.5
@migerh
migerh / dcpu spec
Created April 26, 2012 07:22
1.3 to 1.4 diff
diff --git a/dcpu b/dcpu
index 56bcc78..dd8cbf7 100644
--- a/dcpu
+++ b/dcpu
@@ -1,6 +1,6 @@
DCPU-16 Specification
Copyright 1985 Mojang
-Version 1.3
+Version 1.4