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
@fogus
fogus / forth.rb
Created January 26, 2012 03:32 — forked from deadprogram/forth.rb
Forth interpreter in 64 lines of Ruby
#!/usr/bin/env ruby
def pop; $stack.pop || raise(StackUnderflow); end
def push(expression); $stack << expression; end
def unary; -> { push(yield pop) }; end
def binary; -> { push(yield pop, pop) }; end
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end
def swap; $stack[-2,2] = $stack[-2,2].reverse; end
$stack = []
@fogus
fogus / rereads.txt
Created September 13, 2023 14:13
rereads
A Gamut of Games
AEgypt trilogy
After Dark
Blood Meridian
Book of the New Sun
Chthon
Factory series
BORGES
Finite and Infinte Games
Flower Phantoms
\ FCP.F, version 1.3 by Ian Osgood iano@quirkster.com
\ A simple chess program written in ANS Forth.
\ Uses Core Extension words:
\ .( .R U.R <> U> ?DO ERASE FALSE NIP TO TRUE TUCK VALUE WITHIN \
\ Uses Exception words: CATCH THROW ABORT"
\ Uses Tools Extension words: [IF] [ELSE] [THEN]
\ Uses String words: TOLOWER /STRING
\ Uses Win32Forth utilities: ms@ CELL CELL- DEFER IS [DEFINED] [UNDEFINED]
\ Will use DEFER/IS/[IS] if available for board iterator and vectors.
{:dossier/id 138
:dossier/status :status/open
:date/created #inst "2023-05-15T17:38:33.258-00:00"
:agency/name "Nu North America, Inc"
:case/title "Morse Inspector"
:case/contents {:path/name "/core"}}
@fogus
fogus / macOS Internals.md
Created May 8, 2023 13:48 — forked from kconner/macOS Internals.md
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

Red Team versus the Agents

At a nuclear weapons lab, a team of elite hackers matches wits with undefeated autonomous defenders

ALBUQUERQUE, N.M.--By the time my escort steers me past the armed guards, key-coded doors, and bags of shredded paper into the heart of Sandia National Laboratories, the rematch has already begun. Inside the Advanced Information Systems Lab, six men sit around a large table loaded with laptops and network cables, which snake over to a rack of high-powered machines labeled BORG SERVER CLUSTER. These men are the defense--the Blue Team in this high-tech version of capture the flag--and they lean back in their chairs confidently. This past March, they claim, their "agents"--computer programs that autonomously cooperate to protect a networked system--became the first defenders ever to thwart Sandia's esteemed Red Team of professional hackers. But that was in a two-day skirmish. Now Steven Y. Goldsmith, the research group's lead scientist, has invited the Red Team to spend this entire we

@fogus
fogus / explore_datafy_nav.clj
Created January 18, 2023 17:50 — forked from sashton/explore_datafy_nav.clj
Clojure datafy/nav exploration
(ns explore-datafy-nav
"Sample code demonstrating naving around a random graph of data.
The graph very likely will have circular references, which is not a problem.
To see the results, execute the entire file.
Each step in the nav process will be printed out, as well as the initial db.
Subsequent executions will generate a new random db."
(:require [clojure.datafy :refer [datafy nav]]))
(defn generate-db
"Generate a random database of users and departments.

Datafy / Nav Rationale

  • The results of eval are not always data
  • The results of eval may be very large or deeply nested
  • We have strong data handling capabilities in Clojure, so how can we leverage them for non-data?
  • Practical consideration: need a console for Datomic Cloud
  • datafy: how to make data
  • nav: how to get more data
@fogus
fogus / fwq.txt
Last active January 11, 2023 15:41
Father Watson is a Jesuit priest with a knack for solving mysteries. Despite his commitment to the Church, he finds himself drawn to the shadowy world of crime and deceit. Whether it's a theft at the local museum or a string of burglaries plaguing the neighborhood, Father Watson is always ready to lend his skills of deduction and observation to the case. With his quick wit and unshakable faith, he is a formidable investigator, able to uncover the truth no matter how deeply it is hidden.
BOOK 1
In "Father Watson's Questions," Father Watson is called upon to investigate a series of strange occurrences at a remote monastery. As he delves deeper into the case, he finds himself confronted with a series of puzzles and riddles that challenge his skills as an investigator. With the help of his keen intellect and faith, Father Watson sets out to solve the mystery, piecing together clues and unraveling a sinister plot that threatens the very foundations of the monastery. Along the way, he must confront his own doubts
@fogus
fogus / ruby-fmt.clj
Created January 25, 2012 20:38 — forked from blacktaxi/ruby-fmt.clj
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))