Skip to content

Instantly share code, notes, and snippets.

@johnmckerrell
johnmckerrell / RunningNumbers.md
Last active June 3, 2024 10:53
Running Numbers

Running Numbers

Annual Totals (km)

  • 2024 - 218 … 32 runs (over 2km) in total as of 3rd June
  • 2023 - 449.1
  • 2022 - 900.9 🥈
  • 2021 - 573.6
  • 2020 - 1,042.1 🥇
  • 2019 - 167.7

Fitness Goals

Future

*. Run a 5k in less than... 19:45? *. Run a trail race *. Run two marathon distances in a year *. Run 1500km in the year *. Bench press my bodyweight *. Run longer more regularly

  • Not sure what this should mean, half marathon at least every 3 months perhaps?
# This has now been released as a real node-red module - node-red-contrib-xvfb - use that rather than copying code from here
@johnmckerrell
johnmckerrell / LongVideos.md
Last active July 26, 2021 17:42
Long Videos

@johnmckerrell collecting a series of long videos that might be interesting to leave on in the space. For time lapses and possibly other overly short videos they could perhaps be run at a very low speed. The idea would be that you could leave these up and they wouldn't be distracting but might be interesting to stop and look at from time to time (so things that are simply videos of train or train journeys might actually end up too distracting).

@johnmckerrell
johnmckerrell / vi.sh
Created July 19, 2014 09:10
Simple vi(m) wrapper that names your current screen based on files you open (then pwd when you quit)
#!/bin/bash
# Simple vi(m) wrapper that names your current screen based on files you open (then pwd when you quit)
IFS=$'\n\t'
echo -ne '\033k'"$*"'\033\\'
/usr/bin/vim $*
echo -ne '\033k'`pwd`'\033\\'
echo

Keybase proof

I hereby claim:

  • I am johnmckerrell on github.
  • I am mcknut (https://keybase.io/mcknut) on keybase.
  • I have a public key whose fingerprint is BD3A 1B2D 20A3 38CA 69ED 5369 EF03 DA5D 02D7 587F

To claim this, I am signing this object:

#!/bin/sh
# check-disk-usage.sh
# John McKerrell 2014
#
# Basic script that pops up a notification if disk usage
# on a given device is over a given figure. Could be run
# in a cronjob for instance as:
# check-disk-usage.sh sda1 95
DISK="$1"
char serialFormat = { 'M', 'K', 'E', 'W', 'D', ' ', ' ', ' ', ' ', 'D', 'W', 'E', 'K', 'M' };
int preambleStopIndex = 4;
int postambleStartIndex = 9;
int formatLength = 13;
int valueLength = 4;
void loop() {
int formatIndex = 0;
char value[valueLength] = { 0, 0, 0, 0 };
@johnmckerrell
johnmckerrell / StringDictionarySubstitution
Created July 15, 2013 11:22
Example of some Objective C I'd like to write
NSDictionary *params = @{
@"vals" : @{
@"flip" : @"1",
@"mirror" : @"0"
}
};
NSString *flipCommand = @"command.cgi?flip={self.vals.flip}&mirror={self.vals.mirror}"
[flipCommand stringByMagicallyApplyingKeyPathsToADictionary:params];
@johnmckerrell
johnmckerrell / Hangman.clj
Last active October 19, 2017 01:16
Very basic clojure Hangman using recursion
(ns hangman.core
(:gen-class)
(:require [clojure.string :as str]))
(defn is_char_in_words?
"Is the char in the words?"
[ch words]
(if (= ch "")
false
(> (.indexOf words ch) -1)