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
;; https://gamedev.stackexchange.com/questions/23625/how-do-you-generate-tileable-perlin-noise | |
(fn make-simplex-noise [radius? harmonics? width? height?] | |
"Generate 2d tiling simplex noise tile. | |
The generated tile will be saved in the user save directory. | |
radius? The radius of the x and y orthogonal circles in 4 d space. Larger radius ~= higher frequency | |
harmonics? How many harmonics do you want to include? Default 3 | |
width? The width of the tile generated | |
height? The height the tile generated | |
example: (make-simplex-noise 10)" | |
(let [r (or radius? 10) |
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
# The following is for ziglang commit 86dc982e74dd17633d2bdc0f5ba8e36c55f78053 | |
# This commit required llvm15, check the cmake errors to see which | |
# version of llvm you need. | |
# I assume you've already installed cmake git etc | |
# Check https://apt.llvm.org/ to see alternatives to this garbage | |
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" | |
# Install the dependencies not found on path |
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 git-changes-p () | |
"Check if there are any changes to the git repo." | |
(with-temp-buffer | |
(process-file-shell-command "git status --porcelain" nil (current-buffer) nil) | |
(not(string= "" (buffer-string))))) | |
(defun git-branch () | |
"Return the current branch of the git repo." | |
(interactive) | |
(or (ignore-errors (magit-get-current-branch)) |
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 lookup-user (user) | |
(let* ((json (mastodon-http--get-json | |
(mastodon-http--api (concat "search?q=" | |
user)))) | |
(accounts (cdr(assoc 'accounts json))) | |
(acct (mapcar (lambda(account) (cdr (assoc 'acct account))) | |
accounts)) | |
(ids (mapcar (lambda(account) (cdr (assoc 'id account))) | |
accounts))) | |
(cl-mapcar (lambda(a b) (list a b)) acct ids))) |