Skip to content

Instantly share code, notes, and snippets.

@willprice
willprice / BubbleSort.java
Created March 27, 2016 18:31
Bubble sort using parameterised and property based tests
package org.willprice.sorting;
public class BubbleSort {
boolean swapped = true;
public int[] sort(int[] array) {
while (swapped) {
swapped = false;
bubble(array);
}

Taskwarrior on Android 6

I had a few issues getting task warrior working on Android 6, so when I inevitably need to set this up again, hopefully I'll remember that I've written this document.

First configure .taskrc.android with the following keys:

  • taskd.server
  • taskd.key
  • taskd.certificate
  • taskd.ca
  • taskd.credentials
@willprice
willprice / boot-files.tree
Last active June 30, 2016 16:09
rEFInd configuration
.
├── backup
│   └── grub
│   └── grub.cfg
├── EFI
│   ├── BOOT
│   │   ├── bootx64.efi
│   │   ├── drivers_x64
│   │   │   ├── btrfs_x64.efi
│   │   │   ├── ext2_x64.efi

Keybase proof

I hereby claim:

  • I am willprice on github.
  • I am willprice (https://keybase.io/willprice) on keybase.
  • I have a public key whose fingerprint is CC72 6003 1EF7 AA27 17CD 1A73 BB32 C350 AEA0 A298

To claim this, I am signing this object:

@willprice
willprice / README-internet-sharing-raspberry-pi.md
Last active October 20, 2016 10:49
Setting up point to point networking on Raspbian with the Raspberry Pi 2

Sharing internet from a laptop/desktop to a Raspberry pi

Assumptions:

  • You're running linux on your laptop/desktop
  • laptop/desktop has an internet connection
  • You've got an ethernet cable between the Raspberry Pi and laptop/desktop

Setup the connection

On the host (e.g. laptop with internet connection):

@willprice
willprice / 20-intel.conf
Last active April 2, 2017 20:28
Xorg magic incantations to make skylake graphics bearable (i.e. no tearing, not very slow, no graphics corruption in chrome)
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
Option "DRI" "2" # DRI3 is now default
Option "AccelMethod" "sna"
EndSection
@willprice
willprice / configure.sh
Created April 3, 2017 14:11
Get .local name resolution on Arch
pacman -S avahi nss-mdns

Example SWI-Prolog echo web server

A simple example showing how to use websockets with SWI Prolog to implement a messaging server.

@willprice
willprice / mediasite-html5.user.js
Created May 13, 2017 19:47
A userscript for forcing HTML5 playback on mediasite lecture websites.
// ==UserScript==
// @name HTML5 Mediasite
// @namespace http://willprice.org/userscripts
// @version 0.0.1
// @description Automatically append &usehtml5=true to mediasite URLs
// @author Will Price
// @match https://*/Mediasite/Play/*
// ==/UserScript==
(function() {
@willprice
willprice / DevBox.BoxStarter.ps1
Created July 27, 2016 21:37
Boxstarter seemingly rebooting constantly
Update-ExecutionPolicy Unrestricted
# System settings
Enable-MicrosoftUpdate
Install-WindowsUpdate -AcceptEula -GetUpdatesFromMs -SupressReboots
Set-StartScreenOptions -EnableBootToDesktop
## Windows features
choco install -y IIS-WebServerRole -source WindowsFeatures
# Desktop settings
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives `