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 / TinyForth.ino
Created January 3, 2022 15:14 — forked from monsonite/TinyForth.ino
A Tiny Forth for Arduino - adapted from code from T. NAKAGAWA
// Tiny FORTH by T. NAKAGAWA 2004/07/04-10,7/29,8/5-6
/*
Tiny FORTH
Experimental Forth for Arduino
T. Nakagawa
2004/07/10
*/
#include <stdio.h>
@fogus
fogus / simpl_2015_32bit_list8.ino
Created September 14, 2021 19:30 — forked from anonymous/simpl_2015_32bit_list8.ino
32bit version of SIMPL "Serial Interpreted Minimal Programming Language"
// SIMPL
// A Serial Interpreted Minimal Programming Language
// Inspired by Txtzyme - by Ward Cunningham
// Ken Boak 2013 - 2016
// Filename simpl_2015_32bit_list8
// Requires UART routines - compiles on Arduino 1.04
// This is the slim version of simpl that removes all of the Arduino specific routines
@fogus
fogus / tforth.asm
Created September 14, 2021 19:30 — forked from anonymous/tforth.asm
TinyForth for AVR by T. NAKAGAWA
; Tiny FORTH
; T. NAKAGAWA
; 2004/08/02-05
; Additional comments by Ken Boak Jan 2016
; Register
; r0: temporary
; r1-15: input buffer (terminated by 0x00, separated by 0x20)
; r16: temporary
@fogus
fogus / VTL.ino
Created September 14, 2021 19:29 — forked from monsonite/VTL.ino
VTL - A Very Tiny Language for Arduino
// Very Tiny Language T. Nakagawa 2004/05/23 2004/06/26
#include <uart.h>
#include <avr/io.h>
#define F_CPU 16000000UL // define the clock frequency as 16MHz
#define BAUD 115200*2
#include <util/setbaud.h> // Set up the Uart baud rate generator
@fogus
fogus / ded.clj
Created July 27, 2021 15:59 — forked from alandipert/ded.clj
Command-line structural data editing
(ns ded
"Structural Data EDitor for Clojure with zippers. Inspired by Interlisp: http://larry.masinter.net/interlisp-ieee.pdf"
(:require [clojure.zip :as z])
(:use [clojure.pprint :only (with-pprint-dispatch code-dispatch pprint)]
[clojure.repl :only (source-fn)]))
(defn print-hr
"Prints 30 dashes and a newline."
[c]
(println (apply str (repeat 30 c))))
@fogus
fogus / cont.clj
Created February 8, 2021 20:55 — forked from hiredman/cont.clj
(ns com.manigfeald.http2.cont)
(defn bind% [m f]
(fn [kont bundle]
(m (fn [value] ((f value) kont bundle)) bundle)))
(defmacro return% [value]
`(fn [kont# bundle#]
((try
(let [v# ~value]
@fogus
fogus / lbForth.c
Created August 13, 2020 18:28 — forked from lbruder/lbForth.c
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
@fogus
fogus / jmc.lisp
Created July 14, 2020 12:52 — forked from xwmx/jmc.lisp
; The Lisp defined in McCarthy's 1960 paper, translated into CL.
; Assumes only quote, atom, eq, cons, car, cdr, cond.
; Bug reports to lispcode@paulgraham.com.
(defun null. (x)
(eq x '()))
(defun and. (x y)
(cond (x (cond (y 't) ('t '())))
('t '())))
@fogus
fogus / README.md
Created June 24, 2020 17:55 — forked from rvagg/README.md
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
;; use spec to define stateful protocols inspired by UBF(b)
;; https://ubf.github.io/ubf/ubf-user-guide.en.html
(require '[clojure.spec.alpha :as s]
'[clojure.core.async :as async])
(defn ubfish
"Takes a protocol definition and four channels. Checks for protocol
violations while copying from-server to-client and from-client
to-server."