Skip to content

Instantly share code, notes, and snippets.

View simon-brooke's full-sized avatar
💭
Semper in faecibus sumus, sole profundam variat.

Simon Brooke simon-brooke

💭
Semper in faecibus sumus, sole profundam variat.
View GitHub Profile
@simon-brooke
simon-brooke / mastodon_block_list.md
Created August 4, 2018 12:00
Mastodon domain blocklist

This is a list of domains currently blocked by the Virtual Steamie; I'll try to keep it up to date.

It's our policy to block domains from which we receive spam. If administrators clean up their act and moderate their own local spammers, then they ought to be allowed off this list, but of course we won't know because we wont see their posts. If you feel that your instance is on this list unfairly, let me know.

  • api.m.to)
  • artoot.xyz)
  • beyblade.m.to)
  • boss.taxi)
  • chicken.m.to)
  • cmx.im)
@simon-brooke
simon-brooke / string-equal-ignore-whitespace.clj
Created March 21, 2018 11:17
Compare strings ignoring differences in whitespace - useful in unit tests!
(require '[clojure.string :as s])
(defn string-equal-ignore-whitespace?
"if `a` and `b` are both strings, ignore whitespace changes when comparing them;
othewise just check for ordinary equality. Return true if `a` and `b` are identical
modulo whitespace changes. Written because I didn't want unit tests to fail just
because of emitted whitespace changes"
[a b]
(if
(and
@simon-brooke
simon-brooke / autobump-snippet.csproj
Created August 24, 2017 18:52
Auto-bump version numbers in msbuild
<UsingTask TaskName="BumpVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ReleaseLevel ParameterType="System.String" Required="false" />
<TargetFileName ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
@simon-brooke
simon-brooke / autobump-snippet.csproj
Created August 24, 2017 18:52
Auto-bump version numbers in msbuild
<UsingTask TaskName="BumpVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ReleaseLevel ParameterType="System.String" Required="false" />
<TargetFileName ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
@simon-brooke
simon-brooke / doxygen-snippet.msbuild
Created August 24, 2017 16:38
How to build documentation with Doxygen from an msbuild script
<PropertyGroup>
<DocDirectory>..\Documentation\</DocDirectory>
<Doxyfile>..\Doxyfile</Doxyfile>
</PropertyGroup>
<Target Name="Doxygen">
<MakeDir Directories="$(DocDirectory)" />
<Exec Command="doxygen.exe $(Doxyfile)" />
</Target>
<Target Name="DoxyClean">
<RemoveDir Directories="$(DocDirectory)\html" />
@simon-brooke
simon-brooke / mountain_sort.clj
Created July 12, 2017 21:46
Mountain sort: sort the largest elements in a sequence to the middle
;; gorilla-repl.fileformat = 1
;; **
;;; # Mountain Sort
;;;
;;; A sorting function that sorts largest to the middle.
;;;
;;; ## A bit about Gorilla Repl
;;;
;;; This file was written in, and can be run and edited in,
@simon-brooke
simon-brooke / .gitconfig
Created June 3, 2017 13:24
Windows .gitconfig for Meld
[user]
email = simon@journeyman.cc
name = Simon Brooke
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
path = C:\\Program Files (x86)\\Meld\\meld.exe
@simon-brooke
simon-brooke / clean-all-repositories.sh
Created December 20, 2016 10:22
Little script for cleaning up all my git repositories
#!/bin/bash
# Little script for cleaning up all my git repositories (i.e. ones I am responsible
# for) in my workspace dir and pushing them back to gihub or to my own server.
pushd ~/workspace
for dir in *
do
if [ -d ${dir} ]
then
@simon-brooke
simon-brooke / keybase.md
Created October 12, 2016 10:24
Proof of identity

Keybase proof

I hereby claim:

  • I am simon-brooke on github.
  • I am simon_brooke (https://keybase.io/simon_brooke) on keybase.
  • I have a public key ASDqWd060Fp973txUuQTP2MwigXHGbjeXF2L3_szPdn6Vgo

To claim this, I am signing this object:

@simon-brooke
simon-brooke / core.clj
Created September 11, 2016 14:29
Getting Timbre v 4.x logging working
;; Taoensso.timbre has been a very good Clojure logging library, but v4.0 was a
;; breaking change and it took me a while to get my head round it, although in
;; fact it's very simple. If you're having trouble with it, try this, which is
;; very simple and works with Timbre 4.7.4
(ns ^{:doc "After upgrading Timbre from 3.x to 4.x, all my applications broke.
I wrote this little test piece to understand what was going wrong. It works."
:author "Simon Brooke"}
chainsaw.core
(:require