Skip to content

Instantly share code, notes, and snippets.

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

Steven Dwy Yoplitein

🔈
[screaming]
View GitHub Profile
@Yoplitein
Yoplitein / PKGBUILD.patch
Created April 1, 2015 15:05
AngelScript PKGBUILD Patch
--- PKGBUILD.old 2015-03-31 06:59:59.000000000 -0700
+++ PKGBUILD 2015-04-01 08:00:47.770024293 -0700
@@ -16,10 +16,12 @@
build() {
cd "$srcdir/sdk/$pkgname/projects/gnuc"
- sed -i -e "/^LOCAL/s:=.*:=${pkgdir}/usr:" makefile
+ sed -i -e "/^LOCAL/s:=.*:=${pkgdir}/usr:" Makefile
+ sed -i -e "s/)_s/)/g" Makefile
+ sed -i -e "s/^\t\$(MAKE) install_shared$//g" Makefile
@Yoplitein
Yoplitein / record.sh
Created April 24, 2015 23:28
Simple script to quickly record a screencast. Requires ffmpeg and https://github.com/lolilolicon/xrectsel
#!/bin/bash
if [ -z "$@" ]; then
echo "./record.sh <filename.webm>"
exit 1
fi
SELECTION=`xrectsel`
INRES=`echo $SELECTION | cut -d"+" -f1`
WIDTH=`echo $INRES | cut -d"x" -f1`
@Yoplitein
Yoplitein / logger_shim.d
Last active August 22, 2021 03:28
vibe.core.log to std.logger bridge
import core.thread;
import std.experimental.logger;
import std.datetime;
static import vibe.core.log;
// has to be in a separate class as Logger.LogEntry is protected :facepalm:
class StdLogger: StdForwardLogger
{
@safe:
@Yoplitein
Yoplitein / list.py
Created August 12, 2015 02:54
Lists symbols in a Mystcraft age data file.
import gzip
import sys
import pynbt
def main():
if len(sys.argv) < 2:
print "list.py <agedata_x.dat>"
return
@Yoplitein
Yoplitein / diff.py
Last active August 29, 2015 14:27
Lists symbols that were added to a Mystcraft age by the grammar.
import difflib
import gzip
import sys
import pynbt
def main():
if len(sys.argv) < 2:
print "diff.py <agedata_x.dat>"
@Yoplitein
Yoplitein / class.lua
Last active September 5, 2015 13:29
Helper function to declare a class in Lua with a Python-esque constructor syntax
function class(ctor, members)
local Class = {}
Class.__index = Class
if members then
if type(members) ~= "table" then
error("Passed non-table type as class members")
end
for k, v in pairs(members) do
@Yoplitein
Yoplitein / color_shift.py
Created September 7, 2015 16:36
Python script to adjust the color values in an image up or down by some number
#!/usr/bin/env python2
import random
import sys
from PIL import Image
limit = 50
def adjust(value):
@Yoplitein
Yoplitein / attr.d
Created October 5, 2015 12:40
Template to quickly fetch attributes from symbols
import std.meta;
/++
Retrieves the attribute of type AttrType from symbol.
If no such attribute exists on the symbol, AttrType.init is returned.
+/
template attribute(AttrType, alias symbol)
{
template match(args...)
@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
#!/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;