Skip to content

Instantly share code, notes, and snippets.

View Metaxal's full-sized avatar

Laurent Orseau Metaxal

  • Google DeepMind
  • London, UK
View GitHub Profile
@Metaxal
Metaxal / quickscript-competition-2020-scripts.rkt
Last active July 10, 2020 07:18
A quickscript to install them all! (from the 2020 competition)
#lang racket/base
;; License: Apache2.0/MIT
(require quickscript
quickscript/base
quickscript/library
racket/gui/base
racket/class
racket/file
@Metaxal
Metaxal / letterfall.rkt
Last active July 11, 2020 10:16
Stare at your code falling like rocks!
#lang racket/base
;;; License: MIT/Apache2.0
;;;
;;; Stare at your code falling like rocks.
(require quickscript
framework/preferences ; to disable syncheck
racket/class
racket/string)
@Metaxal
Metaxal / keymap.rkt
Created July 13, 2020 11:42
Reuse global keymap functions for a custom keymap
(define map-global-function
(let* ([km-global (keymap:get-global)]
[table (for/hash ([name (in-list (dict-values (send km-global get-map-function-table)))])
(values name #t))])
(λ (km key name)
(unless (dict-has-key? table name)
(error "Unknown function" name))
(send km add-function name
(λ (in ev)
(send km-global call-function name in ev #t)))
@Metaxal
Metaxal / show-highlighted.rkt
Created July 13, 2020 15:26
quickscript: simply displays the highlighted text "flashing" 5 times in a World-window in random colors
#lang racket/base
;;; From: https://github.com/Quickscript-Competiton/July2020entries/issues/9
;;; License: Apache 2/MIT
#|
My first submitted Racket Quickscript
(mostly a proof-of-concept, to try my hand at writing these)
@Metaxal
Metaxal / defines.rkt
Last active July 17, 2020 13:20
A quickscript to list and search the top level definitions
#lang racket/base
;;;; License: MIT/Apache2.0
(require quickscript
racket/gui/base
racket/class
racket/list
racket/match
racket/string
@Metaxal
Metaxal / open-recent.rkt
Last active March 31, 2022 12:09
A quickscript to open a recent file via a search-list-box for easier retrieval
#lang racket/base
(require racket/gui/base
racket/class
racket/list
quickscript
quickscript/utils
framework
search-list-box)
@Metaxal
Metaxal / keybindings.rkt
Last active August 3, 2020 17:35
A quickscript to show the active keybindings
#lang racket/gui
;;; License: MIT/Apache2
(require quickscript
search-list-box)
(script-help-string "Show active keybindings")
(define-script keybindings
@Metaxal
Metaxal / struct-with-dict-construction.rkt
Last active August 28, 2020 09:18
Struct construction using dictionaries
#lang racket/base
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;;; [MIT license](http://opensource.org/licenses/MIT) at your option.
(require racket/list)
(define mstructs (make-hasheq))
;; mstruct's can be used just like normal structs, but can also use the nicer `construct` constructor.
@Metaxal
Metaxal / move-line.rkt
Last active February 1, 2021 13:38
A quickscript to move the current line up or down
#lang racket/base
;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;; [MIT license](http://opensource.org/licenses/MIT) at your option.
(require quickscript
racket/class)
(define-script move-line-up
#:label "move-line-up"
@Metaxal
Metaxal / interactions2pdf.rkt
Last active February 1, 2021 13:37
Save interactions to pdf
#lang racket/base
;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;; [MIT license](http://opensource.org/licenses/MIT) at your option.
(require quickscript
racket/class)
(script-help-string "Saves the interactions to a pdf file")