Skip to content

Instantly share code, notes, and snippets.

View eigenhombre's full-sized avatar

John Jacobsen eigenhombre

View GitHub Profile
;; Adaptation, in l1, of my Clojure adaptation[1] of Douglas
;; R. Hofstadter's humorous Lisp program published in Metamagical Themas,
;; Scientific American, 1983:
;; [1] http://johnj.com/posts/oodles/
(def recipes '((TOMATOES (TOMATOES on MACARONI (and TOMATOES only)
exquisitely SPICED))
(MACARONI (MACARONI and CHEESE (a REPAST of Naples, Italy)))
(REPAST (rather extraordinary PASTA and SAUCE, typical))
(CHEESE (cheddar, havarti, emmentaler
From https://gist.github.com/eigenhombre/204400c786f9dba3a8d3193d3ce1542a:
See also: http://johnj.com/posts/practices/
- [ ] LICENSE file, including disclaimer
- [ ] Automated build via Docker and GitHub Actions
- [ ] Automated builds include unit tests
- [ ] Automated builds include linting
- [ ] Artwork
- [ ] Versioned
10:50:18 janet 56.4F ≡ * ☐ ~ (master) > time ./build/janet -e '(print "hello")'
hello
real 0m0.009s
user 0m0.004s
sys 0m0.003s
10:50:21 janet 56.4F ≡ * ☐ ~ (master) > time clojure -e '(println "hello")'
WARNING: When invoking clojure.main, use -M
hello
@eigenhombre
eigenhombre / romannums.lisp
Last active June 4, 2022 02:23
Parsing Roman Numerals
(defparameter +lookups+ '((CM . 900)
(M . 1000)
(CD . 400)
(D . 500)
(XC . 90)
(C . 100)
(XL . 40)
(L . 50)
(IX . 9)
(X . 10)
@eigenhombre
eigenhombre / main.go
Last active May 20, 2022 14:01
War Permutations - Uniqueness and Tracking
// See http://johnj.com/art/warperms/ for context....
package main
import (
"fmt"
"math/rand"
"os"
"time"
)
My Apple devices started stating "incorrect password" for my network, even though they had conncted previously.
So how to fix Unifi network "incorrect password" error on iPhone, iPod, iPad and Macbook pro?
The reason for the error is the WiFi management done on iOS devices.
The default settings for the Unifi AP range are not compatible with iOS 11 and 12 and OSX High Sierra (and maybe more).
The reason for the error is the "DTIM Mode" (beacon timing) setting for power saving.
@eigenhombre
eigenhombre / resume.json
Created February 13, 2021 18:52
Resume in JSON
{"basics":{"email":"eigenhombre+resume@gmail.com","name":"John Jacobsen","label":"Non-Human","website":"http://johnj.com/tech.html"},"meta":{"theme":"elegant"}}
#!/usr/bin/env bb
(require '[babashka.curl :as curl])
(let [{:keys [body status]}
(curl/get "https://projects.fivethirtyeight.com/2020-election-forecast/us_simulations.json")
winner-map
(->> true
(json/parse-string body)
first
@eigenhombre
eigenhombre / core.clj
Created April 8, 2020 02:25
Quick and dirty look at Cook County COVID19 cases
(ns covid19.core
"
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
@eigenhombre
eigenhombre / plot.py
Last active February 29, 2020 03:43
plotting numbers from stdin
#!/usr/bin/env python
import random
import matplotlib.pyplot as plt
import numpy as np
import sys
def histnums(filename, x, nbins=100):
fig, ax = plt.subplots()
ax.hist(np.array(x), bins=nbins, density=True)