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 / 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]))
@fogus
fogus / clojure-deftype-scaffolding.clj
Created November 17, 2022 20:31 — forked from semperos/clojure-deftype-scaffolding.clj
Clojure Scaffolding for deftype (Christophe Grand) - Show which methods a class implements and for which interfaces
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ
(defn scaffold [iface]
(doseq [[iface methods] (->> iface .getMethods
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
(doseq [[_ name argcount] methods]
(println

Inspirational

Non-computing books that are highly-relevant to computing

@fogus
fogus / family-trees.txt
Created August 2, 2012 00:58 — forked from zerokarmaleft/family-trees.txt
Game of Thrones Challenge #65
AA = Rickard Stark (M) AB = Eddard Stark (M) AC = Catelyn Tully (F)
AD = Brandon Stark (M) AE = Benjen Stark (M) AF = Jon Snow (M)
AG = Robb Stark (M) AH = Sansa Stark (F) AI = Arya Stark (F)
AJ = Bran Stark (M) AK = Rickon Stark (M) AL = Hoster Tully (M)
AM = Minisa Whent (F) AN = Edmure Tully (M) AO = Lysa Tully (F)
AP = Jon Arryn (M) AQ = Robert Arryn (M) AR = Tytos Lannister (M)
AS = Tywin Lannister (M) AT = Joanna Lannister (F) AU = Kevan Lannister (M)
AV = Cersei Lannister (F) AW = Jamie Lannister (M) AX = Tyrion Lannister (M)
AY = Robert Baratheon (M) AZ = Joffrey Baratheon (M) BA = Myrcella Baratheon (F)
BB = Tommen Baratheon (M) BC = Lancel Lannister (M) BD = Steffon Baratheon (M)

-*- mode: org -*-

Notes for Out of the Tarpit – the decomplector’s handbook

FUNCTIONAL RELATIONAL PROGRAMMING

Maybe a summary of this could be:

  • minimize mutable state
  • move the remaining into relations
  • manipulate relations with a declarative lang
@fogus
fogus / enfield.rkt
Created February 19, 2013 21:07
The complete implementation of Enfield including interpreter, core library, IDE, compiler, web server and pictures of fish. Patches welcomed! http://blog.fogus.me/2013/01/21/enfield-a-programming-language-designed-for-pedagogy/
#lang racket
@fogus
fogus / hol.org
Last active September 23, 2022 12:22

House of Leaves

Building a library from …

original thread

?titleauthorcategorynote(s)
[ ]S, M, L, XLBruce Mau and Rem Koolhaasarchitecture
[ ]Seven Lamps of ArchitectureJohn Ruskinarchitecture
(ns irepl)
(defn inspect [val]
(println "adding inspect message " {:op :inspect :val val})
val)
(defn- irepl-eval [form]
(clojure.core/eval
`(let [~'inspect ~inspect]
~form)))
/*
Copyright (c) 2007 Alessandro Warth <awarth@cs.ucla.edu> and Stephen Murrell <stephen@rabbit.eng.miami.edu>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following