Skip to content

Instantly share code, notes, and snippets.

View fogus's full-sized avatar
💭
attempting to learn how to better learn

Fogus fogus

💭
attempting to learn how to better learn
View GitHub Profile
; Stumbling towards Y
;
; The applicative-order Y combinator is a function that allows one
; to create a recursive function without using define.
; This may seem strange. Usually a recursive function has to call
; itself, and thus relies on itself having been defined.
;
; Regardless, here we will stumble towards the implementation of the
; Y combinator (in Scheme).
@fogus
fogus / d6.clj
Last active April 7, 2025 15:08
(defn range-3d6
"A function to return the possible rolls with 3d6 between start and end inclusive."
([n] (list n))
([start end]
(for [d100s (range 1 7)
d10s (range 1 7)
d1s (range 1 7)
:let [num (+ (* 100 d100s) (* 10 d10s) d1s)]
:when (and (<= start num) (<= num end))]
num)))
:async-259
(System/setProperty "clojure.core.async.go-checking" "true")
(Boolean/getBoolean "clojure.core.async.go-checking")
(require '[clojure.core.async :as async])
(require '[clojure.core.async.impl.dispatch :as d])
@#'clojure.core.async.impl.go/go-checking
(let [c (async/chan 1)]
A
B
C
D
E
F
G
H
I
J
(ns fogus.vthreads
(:require [clojure.core.async :as ca]))
(set! *warn-on-reflection* true)
ca/io-thread-exec
(let [c (ca/chan)]
(ca/io-thread (ca/>!! c "hello"))
(assert (= "hello" (ca/<!! (ca/io-thread (ca/<!! c)))))
@fogus
fogus / juxt.bib
Last active December 24, 2024 12:02
@book {Arbib-Manes:75,
AUTHOR = "Arbib, M. and Manes, L.",
TITLE = "Arrows, Structures and Functors:
The Categorical Imperative",
NOTE = "Home library",
PUBLISHER = "Academic Press",
YEAR = 1975}
@incollection{Backus-etal:90,
AUTHOR = "J.W. Backus and J. Williams and E.W. Wimmers",
TITLE = "An Introduction to the programming Language {FL}",
@fogus
fogus / task.clj
Last active December 19, 2024 17:12
;; testing task impl on dev-vthreads branch
;; requires JDK 21+
(ns c.c.async
(:require [clojure.core.async :as ca]))
(set! *warn-on-reflection* true)
(let [c (ca/chan)]
(ca/task (ca/>!! c "hello"))
@fogus
fogus / arena-macos-fixes.sh
Created November 13, 2024 22:39 — forked from april/arena-macos-full-screen-fixes.sh
Fixes Magic Arena's broken full screen implementation on macOS
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
# to find the scaled resolutions, go to System Preferences --> Display and then
# divide the width by 16 and multiple by 9. on my personal system this ends up
Copyright© Technovelgy LLC; all rights reserved.
Name Purpose Author (Publication Date) Category
Andy - an artificial human A slang term for "android" - an artificially created humanoid being. Philip K. Dick (1968) ai
Autobutle An automated servant. Frank Herbert (1972) ai
Automaton Chessplayer - the first chess-playing computer The first chess-playing computer. Ambrose Bierce (1910) ai
Automonk A robot with an AI trained on an individual monk. Ray Naylor (2022) ai
Ava - she wants to be taught A piece of learning software. Amitav Ghosh (1995) ai
Bard A machine that invents randomized stories and can read them out loud or animate them for viewing. Isaac Asimov (1956) ai
Bendix Anxiety Reducer Machine-based psychotherapy. Robert Sheckley (1956) ai
Big Computer - wide-screen Jehovah Just like it says; this computer knows it all. John Varley (1983) ai
@fogus
fogus / README
Created September 11, 2024 17:18
n/a