Skip to content

Instantly share code, notes, and snippets.

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

Steven Dwy Yoplitein

🔈
[screaming]
View GitHub Profile
public import std.typecons: Yes, No;
struct ClampedNumber(NumericT)
{
import std.traits: isNumeric;
import std.typecons: Flag;
alias Numeric = NumericT;
alias TrackUnclamped = Flag!"trackUnclamped";
@Yoplitein
Yoplitein / compile-scss.js
Last active May 27, 2018 06:20
Use sass.js to compile SCSS stylesheets on-the-fly in the browser
/*
Compiles SCSS files on-the-fly in the browser. Minimal example:
<!DOCTYPE html>
<html>
<head>
<!-- Strips content from the head of imported SCSS files to calculate the logical path. Optional. -->
<meta name="scss-prefix" content="src">
<!-- Dependencies and this script. -->
@Yoplitein
Yoplitein / purify.lua
Created February 23, 2018 12:22
OpenComputers robot script to automatically purify stone and wood into their Botania living variants
local SLOT_PICKAXE = 14
local SLOT_AXE = 15
local SLOT_COAL = 16
local SLOT_LAST = 12
local SLEEP_DELAY = 30
local component = require("component")
local robot = require("robot")
local inv = component.inventory_controller
local geo = component.geolyzer
#!/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