Skip to content

Instantly share code, notes, and snippets.

Arthur Corenzan haggen

Block or report user

Report or block haggen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@haggen
haggen / post-commit
Created Sep 23, 2019
Random post-commit hook saved for later reference
View post-commit
#!/usr/bin/env bash
set -euxo pipefail
last-commited-files() {
git diff-tree --no-commit-id --name-only -r HEAD
}
message="Bumping"
@haggen
haggen / install.bat
Created Sep 14, 2019
Make directory links in Windows via batch script
View install.bat
@echo off
if "%~1" == "" goto missing
if not exist "%~1\" goto invalid
if "%~2" == "" goto missing
if not exist "%~2\" goto invalid
for /f %%f in ('dir /b "%~1"') do (
mklink /D "%~2\_%~1_\Interface\AddOns\%%f" "%~f1\%%f"
@haggen
haggen / bump.sh
Created Sep 12, 2019
Parse and bump version strings
View bump.sh
#!/usr/bin/env bash
set -euo pipefail
if test -z "$*"; then
echo "Missing argument, e.g. $0 classic/Fastbind" >&2
exit 1
fi
if ! test -d "$1"; then
View questie-race-class-bitmask.js
var warror = 0000000000001
var paladin = 0b00000000010
var hunter = 0b00000000100
var rogue = 0b00000001000
var priest = 0b00000010000
var shaman = 0b00001000000
var mage = 0b00010000000
var warlock = 0b00100000000
var druid = 0b10000000000
@haggen
haggen / setup.sh
Created Aug 20, 2019
wine-staging on Elementary 5.0 "Juno"
View setup.sh
#!/bin/bash
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install libvulkan1 libvulkan-dev vulkan-utils
sudo apt install libfaudio0
sudo apt install --install-recommends wine-staging
@haggen
haggen / functions.php
Last active Aug 8, 2019
WordPress REST endpoint for dispatching emails
View functions.php
<?php
/*
* Mailer. Post to /wp-json/mysite/v1/mailer with the following fields:
* - captcha: Leave it blank. Fails otherwise.
* - _wp_nonce: Return value from wp_create_nonce().
* - name: Name of the sender.
* - email: Email of the sender.
* - subject: Subject of the message.
* - message: Content of the message.
@haggen
haggen / script.lua
Created Jun 4, 2019
WoW chat frames
View script.lua
ChatFrame1:ClearAllPoints();
ChatFrame1:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, 85);
ChatFrame1:SetWidth(608);
ChatFrame1:SetHeight(200);
ChatFrame2:ClearAllPoints();
ChatFrame2:SetPoint("BOTTOMLEFT", "ChatFrame1", "TOPLEFT", 0, 35);
ChatFrame2:SetWidth(608);
ChatFrame2:SetHeight(200);
@haggen
haggen / timehttp.go
Created May 27, 2019
Time HTTP requests in Go.
View timehttp.go
package main
import (
"crypto/tls"
"fmt"
"net/http"
"net/http/httptrace"
"time"
)
View eso-add-on-releaser.sh
#!/usr/bin/env sh
path="$(realpath "$1")"
test "$path" = "" && { echo "Usage: $0 <path>" >&2; exit 1; }
test -d "$path" || { echo "$path does not exist" >&2; exit 1; }
pushd "$path"
test -d .git || { echo "not a git repository" >&2; exit 1; }
name="$(basename "$path")"
version="$(grep -Po "# Version: \K.+" "$name.txt")"
git archive --format=zip -o "../$name-$version.zip" --prefix="$name/" HEAD .
@haggen
haggen / migrations.sql
Created Apr 25, 2019
Pure SQL migration procedure for PostgreSQL.
View migrations.sql
-- Migration script in pure SQL.
-- This script is ran at server boot-up.
--
\set on_error_stop true
-- Migration temporary sequence.
--
create temporary sequence migration_steps;
You can’t perform that action at this time.