Skip to content

Instantly share code, notes, and snippets.

View pnathan's full-sized avatar
⚒️
worker

Paul Nathan pnathan

⚒️
worker
View GitHub Profile
@pnathan
pnathan / build.sc
Created May 14, 2020 17:34
mill starter method
// -*- mode: Scala; -*-
import mill._
import mill.scalalib._
import coursier.maven.MavenRepository
object project extends ScalaModule {
def scalaVersion = "2.12.6"

Keybase proof

I hereby claim:

  • I am pnathan on github.
  • I am pnathan (https://keybase.io/pnathan) on keybase.
  • I have a public key ASBc-_Xn5rpPgnyAGz9BneeRsN4dVEUa9I9RRFdgkdVEVwo

To claim this, I am signing this object:

@pnathan
pnathan / qui.py
Created January 1, 2019 23:42
World simulator, has similarties and inspirations from dwarf fortress
# Licensed under AGPL3
from pprint import pprint, pformat
from enum import Enum
world = []
buf=""
def flush():
global buf
print(buf)
@pnathan
pnathan / fb_to_blog.lisp
Created December 23, 2018 09:13
facebook post archive -> md file generator
;; this code is (C) Paul Nathan (@[email protected]), licensed
;; under AGPL3, or CC0, or Public Domain. Whichever the reader
;; desires.
;;
;; essential instructions:
;;
;; download and unzip the archive file, IN JSON FORMAT, from the Zuckerland.
;; this file goes in the toplevel of that directory.
@pnathan
pnathan / inotify_exec_on_file_change.sh
Created December 16, 2017 07:42 — forked from gwpl/inotify_exec_on_file_change.sh
inotifywait to exec specified command on each file change -> e.g. run "make", "pdflatex", or any other compile/upload or other command of choice! (Thanks https://superuser.com/a/181543/81861 ! )
#!/bin/bash
# Example usecase:
# inotify_exec_on_file_change.sh /path/phd paper.tex pdflatex paper.tex
dirn="$1"
filen="$2"
shift 2
echo "Watching directory $dirn for changes of file $filen . Watching directory insteaf of file to overcome behaviour of many text editors that replace file - Thanks to Giles and see his answer https://superuser.com/a/181543/81861 for more details. In case of matching even I execute:" $@
@pnathan
pnathan / flexijects.lisp
Created November 21, 2017 09:01
pure CL prototype-based objects
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; flexijects. An object system for CL.
;;;;
;;;; Uses closures and lists.
;;;;
;;;; CC0 - Paul Nathan, 2015.
;;;;
;;;;
(defparameter *known-classes* nil
@pnathan
pnathan / forager.lisp
Created September 26, 2017 07:16
forager.lisp
(yason:parse
(flexi-streams:octets-to-string
(drakma:http-request "https://mastodon.social/oauth/token"
:method :post
:parameters
`(("client_id" . ,*client-key*)
("client_secret" . ,*client-secret*)
("grant_type" . "authorization_code")
("code" . ,*token*)
("scope" . "read")

Keybase proof

I hereby claim:

  • I am pnathan on github.
  • I am pnathan (https://keybase.io/pnathan) on keybase.
  • I have a public key whose fingerprint is AE27 90E8 CAF3 0681 D91F 582F 4BC4 2EFF CC33 817C

To claim this, I am signing this object:

@pnathan
pnathan / pnathan.lisp
Created April 9, 2017 06:32
pnathan.com
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; pnathan.com
;;;;
(ql:quickload '(:cl-who
:alexandria
:cl-fad
:cl-ppcre
:cl-markdown
@pnathan
pnathan / syntax.ml
Created June 14, 2016 07:29
ocaml syntax error
let table_to_json table =
let open Ezjsonm in
let row_to_triple row =
json_of_triple { row.(0) ; row.(1) ; row.(2) } in
list (Array.to_list (Array.map row_to_triple table))