Skip to content

Instantly share code, notes, and snippets.

View Yoplitein's full-sized avatar
🔈
[screaming]

Steven Dwy Yoplitein

🔈
[screaming]
View GitHub Profile
#!/usr/bin/env python3
"""
Updater script for freedns.afraid.org
(Should work with other services that have you simply GET a URL to update)
Also sends you emails if something's wrong or when your IP is updated,
provided you have a local email server.
Additionally, passing --cron as an argument will let cron handle the email.
Suggested crontab entry:
@Yoplitein
Yoplitein / collage.d
Created October 20, 2016 16:57
Assembles a quick collage from a directory of images
#!/usr/bin/env dub
/+ dub.sdl:
name "collage"
dependency "imageformats" version="~>6.1.0"
dependency "mustache-d" version="~>0.1.1"
+/
import std.algorithm;
import std.array;
import std.file;
@Yoplitein
Yoplitein / fuckup.d
Last active August 1, 2016 00:54
Take some text and just fuck it up with Discord-flavour markdown formatting
import std.algorithm;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.utf;
void main(string[] args)
{
if(args.length < 2)
@Yoplitein
Yoplitein / check.sh
Created July 25, 2016 04:42
Find git commits with mismatched commit/author dates
git log --format=format:"%H/%cd/%ad" | rdmd filter.d
@Yoplitein
Yoplitein / whitespace.d
Created June 20, 2016 08:13
Script to locate whitespace errors among files in given directories
#!/usr/bin/env rdmd
import std.algorithm;
import std.file;
import std.range;
import std.regex;
import std.stdio;
void main(string[] args)
{
@Yoplitein
Yoplitein / zalgo.d
Last active June 18, 2016 23:18
Zalgo text generator
import std.algorithm;
import std.array;
import std.file: writeFile = write;
import std.getopt;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.uni;
import std.utf;
@Yoplitein
Yoplitein / CMakeLists.txt
Last active May 31, 2016 06:05
CMake build script for a Metamod plugin
cmake_minimum_required(VERSION 3.0)
project(changeme)
set(METAMOD_PATH "" CACHE PATH "Path to Metamod-p source root")
if(NOT METAMOD_PATH)
message(FATAL_ERROR "METAMOD_PATH must be defined.")
endif()
#HLSDK includes
@Yoplitein
Yoplitein / list-mods.py
Last active April 18, 2016 22:30
Generates a list of mods in a Minecraft instance. Run from parent of mods directory.
import glob
import os
import re
import zipfile
nameRe = re.compile(r'"name"\s*:\s*"([^"]+)"')
mods = []
def guess(jar):
return os.path.split(jar)[-1].split("-", 1)[0]
#!/usr/bin/rdmd
module git_generate_changelist;
import std.algorithm;
import std.array;
import std.exception;
import std.json;
import std.process;
import std.range;
import std.stdio;
@Yoplitein
Yoplitein / rcon.d
Last active January 28, 2016 21:45
GoldSrc legacy RCON client
import std.algorithm;
import std.array;
import std.datetime;
import std.getopt;
import std.range;
import std.socket;
import std.stdio;
import std.string;
class ReadFailed: Exception