This file contains hidden or 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
(defvar ronie/god-tab-mode-map (make-sparse-keymap)) | |
(define-minor-mode ronie/god-tab-mode | |
"Make <tab> a 'god key' for editing code, according to the context and my preferences ;p" | |
:lighter " GT" | |
:keymap ronie/god-tab-mode-map | |
(if (bound-and-true-p ronie/god-tab-mode) | |
(message "Jumper mode activated!") | |
(message "Jumper mode deactivated!"))) |
This file contains hidden or 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
xkbprint -label name -o keyboard-layout.ps $DISPLAY; ps2pdf keyboard-layout.ps |
This file contains hidden or 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-modules (oop goops) | |
(srfi srfi-1) ;; sane lists | |
(srfi srfi-26) ;; cut | |
(srfi srfi-42) ;; list comprehension | |
(srfi srfi-69) ;; hash-table | |
(srfi srfi-88)) ;; keywords | |
;; Upper lambda as an alias for "cut" | |
(define-syntax Λ (identifier-syntax cut)) |
This file contains hidden or 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-modules (srfi srfi-1) ;; list operations | |
(srfi srfi-11) ;; let-values | |
(srfi srfi-41) ;; streams | |
(srfi srfi-42) ;; list comprehension | |
(srfi srfi-88) ;; keyword as "this:", not only "#:this" | |
(oop goops) ;; function overloading ("OOP" is _not_ the main point) | |
((ice-9 format) #:prefix fmt.)) | |
(define-syntax def (identifier-syntax define-method)) |
This file contains hidden or 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
keycode 8 = | |
keycode 9 = Caps_Lock NoSymbol Caps_Lock | |
keycode 10 = 1 exclam 1 exclam onesuperior exclamdown | |
keycode 11 = 2 at 2 at twosuperior onehalf | |
keycode 12 = 3 numbersign 3 numbersign threesuperior threequarters | |
keycode 13 = 4 dollar 4 dollar sterling onequarter | |
keycode 14 = 5 percent 5 percent cent U2030 | |
keycode 15 = 6 dead_diaeresis 6 asciicircum notsign diaeresis | |
keycode 16 = 7 ampersand 7 ampersand dead_belowdot dead_abovedot | |
keycode 17 = 8 asterisk 8 asterisk dead_ogonek dead_horn |
This file contains hidden or 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 (pre-condition assertion) 'noop) | |
(define (try . procs) | |
(let loop ([procs procs]) | |
(define proc (car procs)) | |
(define (make-pre-condition k) | |
(lambda (assertion) | |
(when (not assertion) | |
(k (lambda () (loop (cdr procs))))))) | |
(define (exec k) |
This file contains hidden or 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 empty? null?) | |
(define empty '()) | |
(define first car) | |
(define rest cdr) | |
(define (split2 item lst) | |
(let loop ([remaining lst] | |
[left empty]) | |
(cond [(empty? remaining) (values (reverse left) empty)] | |
[(equal? item (first remaining)) (values (reverse left) (rest remaining))] |
This file contains hidden or 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
(trace-define-syntax power-let | |
(syntax-rules (<-) | |
[(_ (v <- expr) rest ...) (let [(v expr)] (power-let rest ...))] | |
[(_ body0 body* ...) (begin body0 body* ...)])) | |
(define-syntax def | |
(syntax-rules () | |
((_ (name args ...) body ...) | |
(define (name args ...) | |
(power-let body ...))))) |
This file contains hidden or 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
function wordGame(words) { | |
let clicks = 0; | |
let correct = 0; | |
function updateScore() { | |
let score = document.querySelectorAll('.word-game-score-panel')[0]; | |
if (clicks == 0) { | |
score.innerHTML = "The Preposition Game<br>Accuracy: 0%"; | |
} else { | |
let accuracy = Math.round(correct / clicks * 100); |
This file contains hidden or 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
function printSolution(element) { | |
let answer = element.getAttribute("data-answer"); | |
let selectedOptions = Array.from(element.selectedOptions).map(e => e.text); | |
if (selectedOptions.includes(answer)) { | |
element.style.border = "2px solid green"; | |
} else { | |
element.style.border = "2px solid red"; | |
} | |
} | |
let prepositions = ["", "on", "at", "in"]; |