Skip to content

Instantly share code, notes, and snippets.

View mheap's full-sized avatar
🦋
Follow me on Bluesky @mheap.dev

Michael Heap mheap

🦋
Follow me on Bluesky @mheap.dev
View GitHub Profile
package main
import (
"flag"
"fmt"
"os"
)
func main() {
name := flag.String("name", "", "your name")
@mheap
mheap / PKGBUILD
Last active January 26, 2016 15:18
git-rook PKGBUILD
# Maintainer: Michael Heap <[email protected]>
pkgname=git-rook
pkgver=0.0.1
pkgrel=1
pkgdesc="A git hook runner that can be used to execute multiple hooks in a git repository."
arch=('any')
url="https://github.com/mtdowling/git-rook"
license=('MIT')
depends=('git')
checkdepends=('bats-git')
Using Ansible 2.0.1, can you pass variables when adding a role dependency?

Integrating open source

You might be stuck working with an internal framework that’s like nothing you’ve ever seen in the wild, but that doesn’t mean you can’t leverage the power of open source in your projects.

Together, we'll take a look at what Composer is and what it can do for you, as well as open source libraries that we can use to solve established problems such as logging and access control.

By taking a look at common problems and how we can integrate freely available tools into our bespoke frameworks we can minimise the amount of code that we have to maintain ourselves, leaving us to do what we do best: build meaningful software.

Capturing an API's behaviour with Behat

Once an API is shipped it doesn't matter if it behaves as originally intended - how it actually behaves is the important part. Consumers depend on it's existing behaviour and we need a way to capture that and ensure that it doesn't change. This is where Behat comes in. Behat is a BDD tool that was built to help design software, but it’s actually a fantastic tool for testing APIs after they have been developed too.

We’ve successfully used this technique to give us the confidence to refactor 5+ year old applications by capturing the existing behaviour before making any changes. Now, I want to share the secrets we learned with you. You don't need existing Behat or testing experience, just a desire to prevent breaking changes in your API.

WordPress as a 12 Factor App

Love it or hate it, WordPress is here to stay. Powering over 25% of the web, it’s one of the most commonly used projects out there.

WordPress strive to make life easy for their end users first and foremost, but what if I told you that with less than an hour’s work you could make it a joy to work with for developers too?

By following the Twelve Factor App methodology (http://12factor.net/) we can deploy WordPress in a way that makes it easy to develop, easy to update and easy to maintain. Come and watch as we take a standard WordPress install and bring it into the future.

@mheap
mheap / bio.md
Last active August 15, 2016 13:10

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise with audiences all around the world at user groups and conferences.

Day to day, Michael is a fixer. He works on whatever needs an extra pair of hands both at his day job and in open source projects. When not immersed in technology, you'll find him either playing various board games or hiking through the countryside.

class Foo {
private _bar: string;
public get bar(){
return this._bar;
}
public set bar(v: string){
this._bar = v;
}
---
driver:
name: docker
use_sudo: false
privileged: true
run_command: /usr/sbin/init
provisioner:
name: chef_zero
require_chef_omnibus: 12.7.2
@mheap
mheap / fix-infinality.md
Created March 23, 2017 13:24 — forked from cryzed/fix-infinality.md
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08: