Skip to content

Instantly share code, notes, and snippets.

View mntmn's full-sized avatar

minute mntmn

View GitHub Profile
(ql:quickload "ningle")
(ql:quickload "cl-mongo")
(use-package 'cl-mongo)
(db.use "test")
(defvar *collections*
(list
(list "pages" "title" "content")
(list "products" "title" "content" "price")
(list "news_items" "date" "author" "content")))
@mntmn
mntmn / osx_framebuffer
Created December 21, 2013 15:49
probably the quickest way to draw pixels on OSX in C. catch: compiles only with -m32 (32 bit arch). :|
#include <Carbon/Carbon.h>
#include <CoreGraphics/CoreGraphics.h>
uint32_t framebuffer[FB_W*FB_H];
WindowRef osx_window;
CGContextRef osx_window_context;
CGContextRef osx_bitmap_context;
void updateFrameBuffer() {
@mntmn
mntmn / gist:8049386
Created December 20, 2013 02:01
list of dependencies in urbit
Undefined symbols for architecture x86_64:
"___gmp_fprintf", referenced from:
__unix_dump in unix.o
"___gmp_fscanf", referenced from:
__unix_scan in unix.o
"___gmp_sprintf", referenced from:
__ho_mop_seal in host.o
"___gmpz_add", referenced from:
_j2_k_191__mood__hoon__add_mc in add.o
_j2_k_191__mood__hoon__add_m in add.o
@mntmn
mntmn / mbp_retina_trackpad.md
Created November 10, 2013 19:02
Good setup for MacBook Pro Retina 13" trackpad in Linux/Xorg/X11 (Debian jessie for me). Handles resting thumb and thumb-click-indefinger-drag correctly. Also fixes jerk/jump on very small movements that ought to be precise.
  1. Use xf86-input-mtrack

Debian Jessie (w/ gnome3) uses the "synaptics" xf86 input module as a default. It is very precise but doesn't support "resting thumb" behaviour that you're used to from OSX.

xf86-input-mtrack is an enhancement of xf86-input-multitouch which is configurable. I built it from source from here: https://github.com/BlueDragonX/xf86-input-mtrack But i see that it's also in the debian package repo. So you probably only need to do:

sudo aptitude install xserver-xorg-input-mtrack

I created an override config in /etc/X11/xorg.conf.d/50-synaptics.conf (create the directory if it doesn't exist) which looks like this:

ds test
mov r8,r14
mov r0,#2
lsl r0,r0,#8
add r0,r0,#2
mov r4,#40
mov r2,#32
mov r11,r0
ds test
mov r8,r14
sym font
mov r0,#0
loopa:
ds test
mov r8,r14 ; back up link-address in r8
mov r2,#0 ; r2 = 0
loopa:
mov r1,#99
lsl r1,r1,#4 ; r1 = 100<<4 = 1600 (40x40 zeichen display)
loopb:
mov r3,#100
lsl r3,r3,#8
mov r4,#0
loopa:
mov r0,#1
lsl r0,r0,#29
mov r1,#50
sub r0,r0,r1
@mntmn
mntmn / gist:6917091
Created October 10, 2013 11:45
thumb assembler in one page of c work in progress
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "slre.h"
char* asm_input;
uint16_t* thumb_output;
value :=
0..1599 // constant
*0..1599 // memory value
*0..1599+0..255 // memory content plus constant
*0..1599+*0..1599 // memory content plus other memory content
target := value // denotes a memory cell