Skip to content

Instantly share code, notes, and snippets.

View dleslie's full-sized avatar

Dan Leslie dleslie

View GitHub Profile
@dleslie
dleslie / gist:fa2f8f32e9a5b5e2acec
Created October 15, 2014 00:55
glxinfo for i915
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
git config --global alias.lg "log --color --graph --pretty=format:'%C(auto)%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@dleslie
dleslie / moglen on guis
Created November 11, 2013 19:58
Moglen on GUIs
What I saw in the Xerox PARC technology was the caveman interface,
you point and you grunt. A massive winding down, regressing away
from language, in order to address the technological nervousness
of the user. Users wanted to be infantilized, to return to a
pre-linguistic condition in the using of computers, and the Xerox
PARC technology`s primary advantage was that it allowed users to
address computers in a pre-linguistic way. This was to my mind a
terribly socially retrograde thing to do, and I have not changed
my mind about that.
@dleslie
dleslie / .xbindkeysrc
Created October 15, 2013 19:28
Adds PgUp and PgDn to a keyboard that doesn't have those buttons.
#PgUp
"xvkbd -xsendev -text "\[Prior]""
m:0x8 + c:111
Alt + Up
#PgDown
"xvkbd -xsendev -text "\[Next]""
m:0x8 + c:116
Alt + Down
(test-group "records"
;; Define a record type with setters for each field
(define-record test (setter bit) (setter byte) (setter nibble) (setter bytes))
;; Define a 'bits' conversion function
(define test-bits
(make-bits
(bit test-bit) ; 1 bit
(byte test-byte) ; 8 bits
(nibble test-nibble) ; 4 bits
(bytes 2 test-bytes))) ; 16 bits
(set! video-conf:clear-color (al:make-color-rgb 0 40 70))
(define credits-scene
(scene
(let* ((screen-padding 50) (credit-text "A game by Dan Leslie")
(label-width 200) (label-height 20)
(label-left (+ screen-padding (random (- video-conf:width label-width (* 2 screen-padding)))))
(label-top (+ screen-padding (random (- video-conf:height label-height (* 2 screen-padding)))))
(rect (make-rectangle label-left label-top label-width label-height))
(label (make-label rect credit-text padding-left: 5 padding-right: 5
(define-syntax lazy-wrap
(syntax-rules ()
((_ val)
(lazy-seq (cons val (lazy-seq '()))))))
(assoc 'window-id (frame-parameters (selected-frame)))
@dleslie
dleslie / gist:3230152
Created August 1, 2012 19:56
ex_opengl_pixelshader
(use allegro lolevel)
(require-library allegro)
(import (prefix allegro al:))
(use allegro-glext allegro-c-util)
(define (abort x)
(display x)
(newline)
@dleslie
dleslie / gist:2475945
Created April 24, 2012 03:12
Maybe example
(do <maybe>
(if #t
'Nothing
'(Just First))
'(Just Second))
; Returns: Nothing
((do <state>
(x <- (/m! gets (lambda (s) (+ s 1))))
(return x))