Skip to content

Instantly share code, notes, and snippets.

View ajmcmiddlin's full-sized avatar

Andrew ajmcmiddlin

  • Brisbane, Australia
View GitHub Profile
@ajmcmiddlin
ajmcmiddlin / helix-numbered-list.md
Created January 20, 2023 00:35
Numbering bullet points in helix editor

Here's a way to number bullet points in helix.

Let's start with a bulleted list.

- Item one
- Item two over
  two lines
- Item three

Install the following packages

# For taffybar/applet icons
gnome2.gnome_icon_theme
hicolor-icon-theme

# To get "old style" tray icons visible --- provides xembed
plasma-workspace
:{
let loadTests _ =
pure $ unlines [
":set -isrc"
, ":set -itest"
, ":l test/Test.hs"
, "import Hedgehog"
, "import WordPressTests"
, "env <- mkEnv"
]
@ajmcmiddlin
ajmcmiddlin / 20180305-YLJ-proposal.md
Last active March 11, 2018 23:55
My YLJ 2018 proposal for a talk on state machine property testing.

Hedgehog State Machine Testing

Category: Technique

Level: Intermediate

Session Type: Talk

Abstract

{ nixpkgsFun ? <nixpkgs>, compiler ? "default", cross ? "" }:
let
pkgs = import nixpkgsFun {};
rpi = pkgs.lib.systems.examples.raspberryPi;
localSystem = pkgs.lib.systems.elaborate { system = builtins.currentSystem; };
crossSystem = if cross == "pi1" then rpi
else if cross == "" then null
else throw "Unknown cross target: " ++ cross;
#!/usr/bin/env ruby
BOARD_SIZE = 3
CELLS = BOARD_SIZE ** 2
MAGIC_SUM = 15
MAGIC_SQUARE = [8,1,6,3,5,7,4,9,2]
SYMBOLS = [:naught, :cross]
Game = Struct.new(:board, :next_symbol, :winner)
@ajmcmiddlin
ajmcmiddlin / unlock-dell-u2711.md
Created October 11, 2017 21:37
Unlocking the Dell U2711

The Dell U2711 on screen display (OSD) can be locked - I think by holding the button immediately above the power button (referred to as button 5 in some places). In my case I locked it totally by accident, and without realising what I'd done.

Unlocking the OSD proved quite the production. I found a [forum post] that contained most of the answer. I'll repeat the useful bit below:

  • Switch the monitor off
  • Disconnect all monitor cabling from the PC (VGA, DVI, HDMI, DP, USB, etc.)
  • Disconnect the monitor power cord from the rear of the monitor
  • Press and hold the monitor power button in for 5 seconds
@ajmcmiddlin
ajmcmiddlin / ubuntu-ova-fixes.md
Last active September 13, 2017 07:04
Fixes required for a portable OVA made from an Ubuntu Vagrant box.

Fixing Ubuntu OVAs made with Vagrant

Context

We have a Vagrantfile in fp-course for creating an Ubuntu environment with course prerequisites available. If you export an appliance (OVA) from the resultant VM, it will have issues when you import it on other machines.

Symptoms

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#!/usr/bin/env stack
-- stack --install-ghc runghc --package hasql
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid ((<>))
import Hasql.Connection (acquire, release, settings)
import Hasql.Decoders (int8, singleRow, value)
import Hasql.Encoders (unit)
import Hasql.Query (statement)