Skip to content

Instantly share code, notes, and snippets.

View shapr's full-sized avatar
🏃
VENTRE À TERRE

Shae Erisson shapr

🏃
VENTRE À TERRE
View GitHub Profile
@shapr
shapr / hfpug.org
Created July 16, 2025 23:46
Slides for my History of Haskell community talk for HFPUG

what I want to communicate to the audience:

You have (my) permission to do anything that you consider beneficial and useful, and you have the ability as well!

All the rules we think are in place are just illusions

if something isn’t being done already, it’s likely there’s no incentive to do that thing (see https://www.noidea.dog/glue ) don’t sacrifice yourself and your future, learn from my mistakes

@shapr
shapr / taxes.org
Created May 4, 2025 16:23
A snippet of my taxes done in org-mode spreadsheets
linevaluetext
150000.adjusted gross income you expect in 2025
^L1
2a15000deductions
linevaluetext
1a46000.taxable 5% income ($4000 rent deduction)
@shapr
shapr / screenshot-svg.el
Created November 25, 2024 20:30
emacs can write out an SVG of the current frame, but requires X11 !
(defun screenshot-svg ()
"Save a screenshot of the current frame as an SVG image.
Saves to a temp file and puts the filename in the kill ring."
(interactive)
(let* ((filename (make-temp-file "Emacs" nil ".svg"))
(data (x-export-frames nil 'svg)))
(with-temp-file filename
(insert data))
(kill-new filename)
(message filename)))
;; run-with-timer is meant to be used when delay is specified in seconds
;; this gonna be a list of pairs of
;; (cons (time-convert nil 'integer) (current-idle-time))
;; that is, (now-in-unix-time, emacs-idle-time-in-seconds)
(defvar fl/activity-intervals nil)
;; looks like timers are
;; 1. a timer variable
(defvar fl/write-interval-timer-var nil)
(defun fl/write-interval ()
@shapr
shapr / busy-timer.el
Created November 19, 2024 00:49
sketch of a busy timer
(defconst shapr-idle-duration 60)
(defvar shapr-busy-timer nil)
(defun shapr-busy ()
(when shapr-busy-timer
(cancel-timer shapr-busy-timer))
;; Do some http stuff here
(setq shapr-busy-timer
(run-with-idle-timer
@shapr
shapr / init.el
Created November 13, 2024 21:21
subset of shae's haskell-mode config
(use-package haskell-mode
:ensure t
:delight " hsk"
:bind (:map haskell-mode-map ([(meta .)] . lsp-find-definition))
:init
(progn
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook #'lsp-deferred)
(add-hook 'haskell-literate-mode-hook #'lsp)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
/* expand.c */
/* Copyright 1994 by Philip Gage */
#include <stdio.h>
/* Decompress data from input to output */
void expand (FILE *input, FILE *output)
{
unsigned char left[256], right[256], stack[30];
short int c, count, i, size;
/* compress.c */
/* Copyright 1994 by Philip Gage */
#include <stdio.h>
#define BLOCKSIZE 5000 /* Maximum block size */
#define HASHSIZE 4096 /* Size of hash table */
#define MAXCHARS 200 /* Char set per block */
#define THRESHOLD 3 /* Minimum pair count */
diff --git a/src/Core.hs b/src/Core.hs
index 08b40dd..2741c26 100644
--- a/src/Core.hs
+++ b/src/Core.hs
@@ -80,7 +80,7 @@ main = do
exitFailure
print ("main loop starts" :: String)
- SDL.initialize [SDL.InitVideo]
+ SDL.initializeAll
❯ nixos-rebuild switch -I nixos-config=./surtr.nix --target-host [email protected]
building Nix...
building the system configuration...
trace: No index state specified for haskell-project, using the latest index state that we know about (2023-01-28T00:00:00Z)!
copying 0 paths...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/vda...
Installing for i386-pc platform.
/nix/store/4ifsgb6ljch39yrshhcr5m8z3q5jzb8g-grub-2.12-rc1/sbin/grub-install: error: cannot find a GRUB drive for /dev/vda. Check your device.map.
/nix/store/dy6wk1rf6cyn2w9d5jmm9z2bwlp0vjbm-install-grub.pl: installation of GRUB on /dev/vda failed: Inappropriate ioctl for device