This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
DataModel.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict); | |
} | |
catch (System.Data.Linq.ChangeConflictException) | |
{ | |
// Microsoft sucks, good fucking luck figuring out what causes this particular exception. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun add-font-lock-keywords (modes new-keywords) | |
(mapc (lambda (mode) | |
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name new-keywords) t) "\\)\\>") | |
(1 font-lock-keyword-face))))) | |
modes) | |
t) | |
(defun remove-font-lock-keywords (modes new-keywords) | |
(mapc (lambda (mode) | |
(font-lock-remove-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name new-keywords) t) "\\)\\>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun add-font-lock-keywords (modes new-keywords) | |
(mapc (lambda (mode) | |
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>") | |
(1 font-lock-keyword-face))))) | |
modes) | |
t) | |
(defun remove-font-lock-keywords (modes new-keywords) | |
(mapc (lambda (mode) | |
(font-lock-remove-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'paredit) | |
(require 'auto-complete) | |
(require 'auto-complete-etags) | |
(require 'yasnippet-bundle) | |
(require 'scheme) | |
;; Some utilities of mine | |
(defun add-font-lock-keywords (modes new-keywords) | |
(mapc (lambda (mode) | |
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(do <maybe> | |
(if #t | |
'Nothing | |
'(Just First)) | |
'(Just Second)) | |
; Returns: Nothing | |
((do <state> | |
(x <- (/m! gets (lambda (s) (+ s 1)))) | |
(return x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use allegro lolevel) | |
(require-library allegro) | |
(import (prefix allegro al:)) | |
(use allegro-glext allegro-c-util) | |
(define (abort x) | |
(display x) | |
(newline) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(assoc 'window-id (frame-parameters (selected-frame))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax lazy-wrap | |
(syntax-rules () | |
((_ val) | |
(lazy-seq (cons val (lazy-seq '())))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |