Skip to content

Instantly share code, notes, and snippets.

View practicalli-johnny's full-sized avatar
😺
Software Engineering education and advocacy with a focus on Clojure

Practicalli Johnny practicalli-johnny

😺
Software Engineering education and advocacy with a focus on Clojure
View GitHub Profile
@practicalli-johnny
practicalli-johnny / firefox-snap-to-deb.sh
Created May 30, 2022 16:41 — forked from jc00ke/firefox-snap-to-deb.sh
Migrate Firefox from snap back to deb on Ubuntu Jammy+
#!/bin/env bash
sudo snap remove firefox
sudo add-apt-repository ppa:mozillateam/ppa
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
@practicalli-johnny
practicalli-johnny / iterate_example.clj
Created May 29, 2019 16:17 — forked from RickMoynihan/iterate_example.clj
Produces Excel like column names
(defn column-names-seq
"Given an alphabet string generate a lazy sequences of column names
e.g.
`(column-names-seq \"abcdefghijklmnopqrstuvwxyz\") ;; => (\"a\" \"b\" \"c\" ... \"aa\" \"ab\")`"
[alphabet]
(->> (map str alphabet)
(iterate (fn [chars]
(for [x chars
y alphabet]
(str x y))))
@practicalli-johnny
practicalli-johnny / boids.clj
Created April 3, 2016 19:33 — forked from rockBreaker/boids.clj
Clojure dojo code for boids (quick and dirty with quil)
(defn location []
[(rand-int 255) (rand-int 255)])
(defn init-locations
[]
(for [i (range 5)] (location)))
(defn dist-vector
[[x1 y1] [x2 y2]]
[(- x1 x2) (- y1 y2)])
@practicalli-johnny
practicalli-johnny / git-loglive
Last active April 6, 2016 17:47 — forked from tlberglund/git-loglive
Git log monitor script
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done
@practicalli-johnny
practicalli-johnny / jax-git-workshop.md
Last active October 11, 2015 17:18 — forked from tlberglund/jax-git-workshop.md
JAX London Git Workshop Notes

JAX Git Workshop

Outline

  • git init project
  • git config --global user.name "Tim Berglund"
  • git config --global user.email "tlberglund@github.com"
  • git status
  • git add <file>
  • Diff
    • git diff
@practicalli-johnny
practicalli-johnny / gist:2037502
Last active April 6, 2016 17:39 — forked from jennifersmith/gist:1968416
Ldnclj dojo - Palindrome detector
(ns clojuredojo.core)
(defn palindrome-detector [thing] (= (reverse thing) (seq thing)) )
(def __ palindrome-detector)
(false? (__ '(1 2 3 4 5)))
(true? (__ "racecar"))
(true? (__ [:foo :bar :foo]))
(true? (__ '(1 1 3 3 1 1)))