Skip to content

Instantly share code, notes, and snippets.

View andrewharmellaw's full-sized avatar

Andrew Harmel-Law andrewharmellaw

View GitHub Profile
@andrewharmellaw
andrewharmellaw / brew_install_java.sh
Created January 1, 2021 17:05
Brew install Java and Jenv
echo "Tapping AdoptOpenJDK/openjdk"
brew tap AdoptOpenJDK/openjdk
echo "Installing Java 8, 13 and 14"
brew install --cask adoptopenjdk14
brew install --cask adoptopenjdk13
brew install --cask adoptopenjdk8
if test ! $(which jenv); then
echo "Jenv was not already available - installing and configuring it"
@andrewharmellaw
andrewharmellaw / osx_bootstrap.sh
Last active January 8, 2021 09:46 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - TBC
@andrewharmellaw
andrewharmellaw / private_fork.md
Created June 1, 2020 08:40 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@andrewharmellaw
andrewharmellaw / FoldingTests.kt
Created March 12, 2020 14:59
Folding in Kotlin (Tests)
@Test
fun `foldLeft on a very large list is stack-safe`() {
val seed = 1;
val massiveList = mutableListOf<Int>()
for (i in 1..10000) {
massiveList.add(i)
}
assertEquals(500501, foldLeft(massiveList, seed, ::sum))
}
@andrewharmellaw
andrewharmellaw / folding.kt
Created March 12, 2020 14:48
Three flavours of Kotlin fold...
fun <A, B> foldLeft(l: List<A>,
seed: B,
func: (b: B, a: A) -> B) : B {
return when {
l.isEmpty() -> seed
else -> foldLeft(l.tail, func(seed, l.head), func)
}
}

Keybase proof

I hereby claim:

  • I am andrewharmellaw on github.
  • I am andrewharmellaw (https://keybase.io/andrewharmellaw) on keybase.
  • I have a public key whose fingerprint is 4D31 BDB1 372D 2D63 250D B99D DF3E C8F6 802E 7882

To claim this, I am signing this object:

@andrewharmellaw
andrewharmellaw / awesomeMonitoring.md
Last active August 22, 2016 13:21
AbstractIdea: Awesome Monitoring for Your Most Mission-Critical Component

For every system you build it is critical to have effective monitoring. Yet most of us have almost no monitoring for our most ubiquitous, most complicated, most important component:- ourselves.

When we are not operating at our full potential, we make mistakes, but we also force errors and inefficiencies in others. If we were a software component we would identify our core elements, monitor them, and act. So how do we achieve this personally? By being mindful and compassionate, both unlocked by the practice of meditation.

This session will cut through the hype (and iPhone apps) and tap into your mindfulness and compassion. You will see how to keep human beings at the core of everything you say and do; how to stay awake and stop yourself (even when "flow" wants you to keep going); and to push yourself to confront those tasks you really don't want to perform.

@andrewharmellaw
andrewharmellaw / levellingThemUp-abstract.md
Last active August 22, 2016 06:55
AbstractIdea: Levelling Them Up - How 80's Roleplaying can Transform Your Team

You have more amazing people working in your team that you realise. The problem is, they probably don't realise it either; yet. This session will show you how framing career development as being like creating and progressing a Role Playing Game (RPG) character gives fantastic results.

As developers none of us are lacking in imagination – many love to geek out in fantasy / sci-fi worlds. So let’s steal a bunch of useful "rules" from RPG character creation / progression at the core of EVERY 80s ROLEPLAYING GAME EVER and apply it. This entails:

  • base characteristics - the appreciation these give of the balance of abilities, inherent and learned
  • experience, its value and "spending" it
  • specific skills - their range, and relevance
  • “careers” - their constraints and longer-term paths they open up
@andrewharmellaw
andrewharmellaw / tracing_trace_4.scala
Created December 23, 2015 07:33
Another, half-way example of a type alias
type DataTypeMap = Map[String, DataTypeAsJson]
@andrewharmellaw
andrewharmellaw / function_type_alias_3.scala
Created December 23, 2015 07:30
The function type alias in use
val int: Rand[Int] = _.nextInt