Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I fly cargo planes full of rubber dogshit out of Hong Kong

pikesley pikesley

💭
I fly cargo planes full of rubber dogshit out of Hong Kong
View GitHub Profile
@pikesley
pikesley / long-tests.js
Last active May 1, 2021
Nightwatch is confusing
View long-tests.js
const url = 'http://foo:8000'
module.exports = {
"The spans have the correct class": function (browser) {
let spans = ['#foo', '#bar', '#a', '#really', '#long', '#list']
spans.forEach(function (span) {
browser
.url(url)
View foo.md

This a heading

This also should be a heading

And this

But not this

View 1-README.md

How to set up a MicroSD card with the NOOBS installer (on a Mac)

Formatting 64GB and larger MicroSD cards with the SD Card Formatter thing no worky, it needs to be FAT32. And I've forgotten that more than once, so I'm writing it down here

This all presumes that you're happy to blat whatever's already on the card

  • Create a new directory
  • Create a Makefile in the directory with the content below
  • Copy the latest NOOBS into the directory
    • make download if you don't already have it
View bumpme
Thu Feb 28 11:16:48 UTC 2019
@pikesley
pikesley / trap.sh
Last active Jan 29, 2019
The Admiral
View trap.sh
mkdir -p /tmp/trap && pushd /tmp/trap && echo -e "FROM alpine\nRUN apk add ack\nCMD clear && echo && ack --bar && echo" > Dockerfile && docker build -t ackbar . && rm Dockerfile && docker run ackbar && popd > /dev/null
@pikesley
pikesley / equestreum-chain.json
Last active Sep 4, 2018
The Horses -v- Ducks vote blockchain, made with https://github.com/hat-festival/equestreum
View equestreum-chain.json
{
"chain_length": 49,
"blocks": [
{
"data": "duck",
"time": 1535910914,
"hash": "0000556b89b5fcf5759862ec7d3c9f5a74979d9c87b378f12889330e500d0868",
"prev": "00009cb06f74e26cd1feea75624d7e967f1f73d763691c6eab268fb068b9e14c",
"nonce": 188474,
"difficulty": 4
@pikesley
pikesley / README.md
Created Apr 2, 2018
FontAwesome 5 SVGs with Leaflet.awesome-markers
View README.md

I recently started using FontAwesome 5's beautiful SVG icons. However I was unable to get them to work on my Leaflet.js markers using https://github.com/lvoogdt/Leaflet.awesome-markers

After a little poking around in the inspection window, I came up with this:

  • You need to give the extraClasses value in your marker definition (fas or fab or whatever, it's on the FontAwesome page for each icon)
  • The default layout is not great, but a little CSS fixes it right up. You'll want to constrain it to only these icons though, using some SASS nesting, or it will screw up all the other FA icons on your page

I hope somebody finds this useful

View This worked for me
ffmpeg -pattern_type glob -i "*.JPG" -c:v libx264 -vf fps=25 -pix_fmt yuv420p ~/Desktop/out.mp4
@pikesley
pikesley / luther.py
Created Dec 15, 2017
Random Poetry Generator
View luther.py
#!/usr/bin/env python
import random
with open('/usr/share/dict/words') as f:
words = list(map(lambda x: x.strip(), list(f)))
structure = [5, 4, 5, 5, 1, 3]
@pikesley
pikesley / hypriot-wifi.sh
Created Nov 23, 2017
Run this as root to configure WiFi for Hypriot https://blog.hypriot.com/
View hypriot-wifi.sh
#!/bin/bash
[ ${2} ] || ( echo "usage ${0} <SSID> <PSK>" && exit 1 )
echo -n "Writing /etc/wpa_supplicant/wpa_supplicant.conf... "
echo "network={
ssid=\"${1}\"
psk=\"${2}\"
}" > /etc/wpa_supplicant/wpa_supplicant.conf
echo "done"