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
| ... | |
| dependencies: | |
| - base >= 4.7 && < 5 | |
| - mtl | |
| - aeson | |
| - servant | |
| - http-client | |
| - http-client-tls | |
| - servant-client | |
| ... |
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
| (ql:quickload :fiveam) | |
| (ql:quickload :trivia) | |
| (use-package :fiveam) | |
| (use-package :trivia) | |
| ;; Haskell-inspired insertion sort implementation, making use of | |
| ;; pattern matching | |
| (defun insertion-sort (list) |
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
| ;;;;;;;;;;;;;;;;;; | |
| ;; Environments ;; | |
| ;;;;;;;;;;;;;;;;;; | |
| (setenv "PATH" "$HOME/.nix-profile/bin:$HOME/.local/bin:$HOME/.roswell/bin:$PATH" '("PATH" "HOME")) | |
| (add-to-list 'exec-path "~/.roswell/bin") | |
| (add-to-list 'exec-path "~/.local/bin") | |
| (add-to-list 'exec-path "~/.nix-profile/bin") | |
| (use-package direnv |
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 *a0-surface-area* 1000000 "Surface area of an A0 sheet in mm^2.") | |
| (cl-defun a-format (n) | |
| "Calculate the A series paper format sizes from first principles." | |
| (assert (<= 0 n 10)) | |
| (let* ((area (ash *a0-surface-area* (- n))) | |
| (shorter (sqrt (/ area (sqrt 2))))) | |
| `(:shorter ,(round shorter) :longer ,(round (* shorter (sqrt 2)))))) | |
| (cl-defun b-format (n) |
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
| ;;;;;;;;;;; | |
| ;; Day 1 ;; | |
| ;;;;;;;;;;; | |
| ;; Input | |
| (defvar *day-1-puzzle-1-input* | |
| '(174 180 179 186 184 176 177 190 173 174 176 175 172 175 174 175 | |
| 176 179 206 207 206 205 208 209 215 221 228 227 214 215 216 218 244 | |
| 246 242 249 250 253 259 256 261 256 252 254 256 261 274 270 300 301 |
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
| /* | |
| Set any config.h overrides for your specific keymap here. | |
| See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file | |
| */ | |
| #define ORYX_CONFIGURATOR | |
| #define USB_SUSPEND_WAKEUP_DELAY 0 | |
| #define FIRMWARE_VERSION u8"DAVGK/raM0n" | |
| #define RGB_MATRIX_STARTUP_SPD 60 |
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
| (defcustom restclient-response-body-only nil | |
| "When parsing response, only return its body." | |
| :group 'restclient | |
| :type 'boolean) | |
| (defun restclient-prettify-response (method url) | |
| (save-excursion | |
| (let ((start (point)) (guessed-mode) (end-of-headers)) | |
| (while (and (not (looking-at restclient-empty-line-regexp)) | |
| (eq (progn |
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 *dict* | |
| '((?a . (alas ask am)) | |
| (?b . (be beaver boulder beam)) | |
| (?c . (can cheat cover)) | |
| (?d . (did does deed dead)) | |
| (?e . (egg elevate eager)) | |
| (?f . (fight false friendship)) | |
| (?g . (gain goal get goose)) | |
| (?h . (help)) | |
| (?i . (indicate insight inside inter)) |
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
| (ql:quickload :drakma) | |
| (ql:quickload :puri) | |
| (ql:quickload :chanl) | |
| (defparameter *nc-host* "https://ma.sdf.org/nc/remote.php/webdav/") | |
| (defparameter *nc-base-collection* "Photos/") | |
| (defparameter *nc-user* "username") | |
| (defparameter *nc-pass* "password") | |
| (defun nc-ensure-collection-exists (collection &key |
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
| (require 'request) | |
| (defvar *exchange-rates-url* "http://api.nbp.pl/api/exchangerates/tables/A/") | |
| (defvar *currencies* '("USD" "CAD" "EUR" "GBP" "JPY" "CHF") "Exchange rate table, relative to PLN") | |
| (defvar *exchange-rates-file* "~/.emacs.d/lisp/exchange-rates.el") | |
| (defvar *exchange-rates* nil) | |
| (defvar *exchange-rates-timer* nil) | |
| (defvar *exchange-rates-update-interval* 60) | |
| (cl-defun fetch-exchange-rates (&key (currencies *currencies*)) |