Skip to content

Instantly share code, notes, and snippets.


Jack Hughes digitalbricklayer

View GitHub Profile
View main.cpp
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <string>
#include <iostream>
class TileMap : public sf::Drawable, public sf::Transformable
bool load(const std::string& tileset, sf::Vector2u tileSize, const int* tiles, unsigned int width, unsigned int height)
View docker-compose.yml
image: klakegg/hugo:0.78.2-ext-ubuntu
command: server -D --gc
- "$PWD/src:/src"
- "1313:1313"
user: "1000:1000"
#!/usr/bin/env bash
# Validate the contents of the sitemap
# See for inspiration
# Start the test server
docker-compose up -d
#!/usr/bin/env bash
# Check redirect destinations work on the dev site
# Start the test server
docker-compose up -d
# Wait for the test server to start up
until $(curl --output /dev/null --silent --head --fail $SITE_URL/); do
digitalbricklayer /
Last active Oct 19, 2020
Simple Python scriptl for exporting Wordpress posts as Hugo posts. The script reads the posts from the database and exports the resulting Hugo posts to the output directory.
import mysql.connector
from datetime import datetime
class Post:
"""A wordpress blog post."""
def __init__(self, post_id, title, slug, content, created_at):
self.post_id = post_id
self.title = title.encode("utf-8")
self.slug = slug
self.content = content.encode("utf-8")
View IpPower9850PowerSocket.ps1
# Switch socket 1 on. All other sockets are assumed to be off
Invoke-WebRequest -Uri ""
digitalbricklayer / IpPower9850ReadSocketState.ps1
Last active Sep 28, 2018
Read the current state of the power sockets on an Aviosys IP Power 9850
View IpPower9850ReadSocketState.ps1
# Read the current state of the power sockets...
Invoke-WebRequest -Uri ""
digitalbricklayer / IpPower9850ReadFirmwareVersion.ps1
Last active Sep 28, 2018
Read IP Power 9850 software version using Powershell
View IpPower9850ReadFirmwareVersion.ps1
# uses default user name and password. Couldn't get the HTTP form to work properly
Invoke-WebRequest -Uri ""
digitalbricklayer / ReadRoomAlertSwitchSensorData.ps1
Last active Jul 19, 2017
How to find switch sensor data from the Room Alert using PowerShell
View ReadRoomAlertSwitchSensorData.ps1
# Switch sensor data
# The examples below use a Room Alert 3E with firmware v2.0.0 and Powershell v5
$result = Invoke-RestMethod -URI ''
# Find the sensor named 'Switch Sen 1'
$result.switch_sen|where{$_.label -eq 'Switch Sens 1'}
# Prints out the following to the console: