Skip to content

Instantly share code, notes, and snippets.

View jordanrobinson's full-sized avatar
:shipit:
Shippin' it

Jordan Robinson jordanrobinson

:shipit:
Shippin' it
View GitHub Profile
@jordanrobinson
jordanrobinson / awaitility.clj
Created September 1, 2023 13:57
awaitility-clj example
(:require [awaitility-clj.core :refer [wait-for]])
(let [start-time (System/currentTimeMillis)
end-time (+ start-time 200)]
(wait-for {:at-most [1 :seconds]} ; options such as at-most and poll-interval
(fn [] (>= (System/currentTimeMillis) end-time)))) ; function that will eventually return true
@jordanrobinson
jordanrobinson / example-code.clj
Last active January 6, 2023 15:55
Awaitility blog post
(defn check-reactor-is-ready
[]
(let [counter (Math/random)]
(println (str "Reading is... " counter))
(> counter 0.5)))
@jordanrobinson
jordanrobinson / audit.sh
Last active November 24, 2022 12:16
code audit bash script
#!/usr/bin/env bash
printf "\n --- $2\n"
git clone "$1" $2 &&
printf "\nCommits on Master: $(cd $2 && git rev-list --count master 2>&1 && cd ..)" &&
printf "\nFirst commit: $(cd $2 && git log --pretty=format:"%h %an %cD %s" --reverse | head -n1 2>&1 && cd ..)\n" &&
printf "\nLines of code:\n\n" &&
cloc $2 &&
printf "\nDependencies:\n\n" &&
printf "Clojure: \n$(cd $2 && lein licenses || echo "N/A" 2>&1 && cd ..)\n\n" || true &&
printf "Javascript: \n$(cd $2 && npm i --silent --no-progress && npx license-report --only=prod --output=csv --fields=name --fields=installedVersion --fields=licenseType || echo "N/A" 2>&1 && cd ..)\n\n" || true &&
[time]
disabled = false
format = '[$time]($style) '
utc_time_offset = "local"
[directory]
truncation_length = 8
truncate_to_repo = false
[env_var]
SetDefaultKeyboard(LocaleID){
Static SPI_SETDEFAULTINPUTLANG := 0x005A, SPIF_SENDWININICHANGE := 2
Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0)
VarSetCapacity(binaryLocaleID, 4, 0)
NumPut(LocaleID, binaryLocaleID)
DllCall("SystemParametersInfo", "UInt", SPI_SETDEFAULTINPUTLANG, "UInt", 0, "UPtr", &binaryLocaleID, "UInt", SPIF_SENDWININICHANGE)
WinGet, windows, List
Loop % windows {
@jordanrobinson
jordanrobinson / gruvbox.css
Created January 22, 2021 16:02
hacker news gruvbox dark theme
* {
color: #928374 !important;
background-color: #282828 !important;
}
body > center > table > tbody > tr:first-child * {
background-color: #504945 !important;
}
body > center > table > tbody > tr:first-child * a:hover {
background: #3c3836 !important;
}
(defn divisible?
[divisor number]
(zero? (mod number divisor)))
(defn fizzbuzz
[number]
(cond (divisible? 15 number) "fizzbuzz"
(divisible? 5 number) "buzz"
(divisible? 3 number) "fizz"
:else (str number)))
@jordanrobinson
jordanrobinson / core-1.clj
Last active November 23, 2020 20:23
blog data
(ns liberator-examples.core
(:require
[ring.adapter.jetty :as ring-jetty]
[ring.middleware.defaults :as ring-defaults]
[liberator-examples.hello-world.resource :as resource])
(:gen-class))
@jordanrobinson
jordanrobinson / spotify-volume.sh
Last active October 15, 2020 09:56
change the volume of spotify from bash command line
#!/bin/bash
LANGUAGE="en_US"
app_name="Spotify"
current_sink_num=
sink_num_check=
app_name_check=
pactl list sink-inputs |while read line; do \
sink_num_check=$(echo "$line" |sed -rn 's/^Sink Input #(.*)/\1/p')
if [ "$sink_num_check" != "" ]; then
current_sink_num="$sink_num_check"
/* ==UserStyle==
@name WaniKani Breeze Dark tweaks
@version 0.0.1
@namespace jordanrobinson.co.uk
@license GPL-3.0
@description Tweaks for WaniKani Dark theme.
==/UserStyle== */
@-moz-document domain(www.wanikani.com) {
#question-type {