Skip to content

Instantly share code, notes, and snippets.

View bb-github-issues.clj
#!/usr/bin/env bb
;;
;; This is a babashka script to calculate the duration a github issue spent in
;; each github project board column. It will output the results in a few
;; different views, where this view is maybe most interesting:
;;
;; | :iss-title | :iss-html | Total | To do | In Progress | Done |
;; |--------------------+--------------+-------+-------+-------------+------+
;; | your issue 1 title | issue 1 html | 100 | 25 | 50 | 25 |
@mmzsource
mmzsource / babashka-football-clojure-asciinema.md
Last active Feb 20, 2021
Babashka script to retrieve the current league tables of some popular football competitions.
@mmzsource
mmzsource / cljs-quil-emacs-figwheel-setup.md
Last active Jan 28, 2021
Setup dynamic Clojurescript and Quil environment with emacs and figwheel
View cljs-quil-emacs-figwheel-setup.md

My environment

  • emacs 26.3
  • cider 0.25.0
  • leiningen 2.9.4 on Java 11.0.2
  • ~/.lein/profiles.clj : {:user {:plugins []}}

Project setup

In a terminal, run these commands:

View maze-generation
(require '[clojure.string :as s])
(declare print-maze)
;; Maze GENERATION
(defn create-grid [rows cols]
(vec (repeat rows (vec (repeat cols #{})))))
(defn north-of [[row col]] [(dec row) col])
(defn south-of [[row col]] [(inc row) col])
View diskusage
#!/bin/bash
#
# This is a script to log (and eventually monitor) diskusage on a filesystem.
# It will write the disk usage to a logfile.
# The logfile will never grow larger than MAX_LINES number of lines.
#
# The script is 'gnu awk' specific. GNU AWK is available on mac (brew)
# and ubuntu (apt-get) as the package 'gawk'.
#
@mmzsource
mmzsource / bezier-in-clojure.clj
Last active Jun 30, 2017
Code belonging to and explained in my "Bézier in Clojure" blog
View bezier-in-clojure.clj
;;
;; Assume leiningen + lein-try plugin installed and working
;;
;; Fire up a repl with:
;;
;; lein try incanter "1.5.7"
;;
(require '[incanter.core :as incanter])
(require '[incanter.charts :as charts])
@mmzsource
mmzsource / soccer-bets-spec-test.clj
Last active Apr 20, 2017
Trying clojure.spec to check, document & generate a league-table datastructure
View soccer-bets-spec-test.clj
;; REPL session to play around with clojure.spec
;; ------------- START INITIAL SETUP -------------
;; assume these dependencies are specified in the repl environment:
;; [org.clojure/clojure "1.9.0-alpha15"]
;; [org.clojure/test.check "0.9.0"]
;; My leiningen setup:
;; cat ~/.lein/profiles.clj