Skip to content

Instantly share code, notes, and snippets.

@erorus
erorus / stale.php
Created December 11, 2017 16:07
script to close stuck-open electrumx server connections
<?php
echo "Starting.. ", date('Y-m-d H:i:s'), "\n";
$conns = [];
$lsof = `lsof -n -a -c electrumx -itcp -sTCP:ESTABLISHED -Ffn`;
$tok = strtok($lsof, "\n");
$pid = 0;
@erorus
erorus / mounts.json
Last active January 28, 2019 00:19
Enhanced Mount Master List 8.1.0.28833
{
"mounts": [
{
"name": "Abyss Worm",
"spellId": 232519,
"creatureId": -74315,
"itemId": 143643,
"qualityId": 4,
"icon": "inv_serpentmount_green",
"isGround": true,
@erorus
erorus / pets.json
Last active August 24, 2018 15:28
Enhanced Pet Master List 8.0.1.27356
This file has been truncated, but you can view the full file.
{
"pets": [
{
"canBattle": true,
"canObtain": true,
"canTrade": true,
"creatureId": 17254,
"description": "One of Ash'alah's litter, entrusted to you by the Dreamweavers.",
"displayId": 37949,
"family": "beast",
@erorus
erorus / titles.csv
Created April 7, 2018 15:53
WoW character titles 7.3.5.26365
1 Private %s Private %s 1 0
2 Corporal %s Corporal %s 2 0
3 Sergeant %s Sergeant %s 3 0
4 Master Sergeant %s Master Sergeant %s 4 0
5 Sergeant Major %s Sergeant Major %s 5 0
6 Knight %s Knight %s 6 0
7 Knight-Lieutenant %s Knight-Lieutenant %s 7 0
8 Knight-Captain %s Knight-Captain %s 8 0
9 Knight-Champion %s Knight-Champion %s 9 0
10 Lieutenant Commander %s Lieutenant Commander %s 10 0
@erorus
erorus / split.php
Created April 18, 2018 16:33
Split blocks of video transcript into paragraphs
<?php
/* quick and dirty paragraph splitter
* by Erorus
*
* this script is fully in the public domain, do what you want with it
*
* intended for use for unformatted video transcripts
* such as ones produced by Ars Technica, e.g.
* https://cdn.arstechnica.net/wp-content/uploads/2018/04/3545034e-f60c-4657-b223-6cde51b5576fcc.txt
@erorus
erorus / migration.md
Last active March 6, 2019 02:41
Mashery -> Blizzard API Migration

Mashery -> Blizzard API Migration

This is intended for developers who are currently using the Battle.net API via Mashery, and need to migrate to Blizzard's own Battle.net API.

The official migration documentation is here but it's wordy and scattered. This document intends to cut the BS for existing developers as a true migration guide.

It's organized into sections based on the different kinds of API calls.

Game Note

This was written with World of Warcraft APIs in mind. While our hostnames are changing, none of WoW's API paths will change. However, some Starcraft II paths will change, so please reference Blizzard's documentation for further information about that.

@erorus
erorus / mount-json-transform.php
Created January 15, 2019 14:57
Enhanced Mount Master List generation
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Erorus\DB2\Reader;
$o = json_decode(file_get_contents(__DIR__ . '/mounts.json'), true);
if (json_last_error() != JSON_ERROR_NONE) {
fwrite(STDERR, "JSON error loading mounts.json: " . json_last_error_msg() . "\n");
exit(1);
@erorus
erorus / hide_api_forum_posts.user.js
Created December 29, 2021 17:47
Hide API Forum Posts
// ==UserScript==
// @name Hide API Forum Posts
// @version 1
// @grant GM.setValue
// @grant GM.getValue
// @include https://us.forums.blizzard.com/en/blizzard/*
// ==/UserScript==
(async function () {
let data = JSON.parse(await GM.getValue('hidden', '[]'));