View main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <SFML/Window.hpp> | |
#include <string> | |
#include <iostream> | |
class TileMap : public sf::Drawable, public sf::Transformable | |
{ | |
public: | |
bool load(const std::string& tileset, sf::Vector2u tileSize, const int* tiles, unsigned int width, unsigned int height) |
View checksitemap.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Validate the contents of the sitemap | |
# See https://blog.atj.me/2018/05/crawl-sitemap-xml-with-curl/ for inspiration | |
SITEMAP_URI="/sitemap.xml" | |
SITEMAP_URL="http://localhost:1313"$SITEMAP_URI | |
# Start the test server | |
docker-compose up -d |
View checkredirects.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check redirect destinations work on the dev site | |
SITE_URL="http://localhost:1313" | |
# 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 |
View checklinks.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check all internal links on the dev site | |
echoerr() { printf "%s\n" "$*" >&2; } | |
# Script requires linkchecker | |
if ! [ -x "$(command -v linkchecker)" ]; then | |
echoerr "Error: linkchecker is not installed" | |
exit 1 |
View docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
image: klakegg/hugo:0.78.2-ext-ubuntu | |
command: server -D --gc | |
volumes: | |
- "$PWD/src:/src" | |
ports: | |
- "1313:1313" | |
user: "1000:1000" |
View wp-hugo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch socket 1 on. All other sockets are assumed to be off | |
Invoke-WebRequest -Uri "http://10.0.0.204/set.cmd?user=admin+pass=12345678+cmd=setpower&p61=1&p62=0&p63=0&p64=0" |
View IpPower9850ReadSocketState.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read the current state of the power sockets... | |
Invoke-WebRequest -Uri "http://10.0.0.204/set.cmd?user=admin+pass=12345678+cmd=getpower" |
View IpPower9850ReadFirmwareVersion.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# uses default user name and password. Couldn't get the HTTP form to work properly | |
Invoke-WebRequest -Uri "http://10.0.0.204/set.cmd?user=admin+pass=12345678+cmd=getversion" |
View RoomAlert.psm1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Gets data from a Room Alert environment monitor. | |
.Description | |
Gets all of the data from a Room Alert environment monitor. | |
.Parameter $address | |
IP address or host name of the Room Alert monitor. |
NewerOlder