Skip to content

Instantly share code, notes, and snippets.

View goto-bus-stop's full-sized avatar
🇵🇸

Renée goto-bus-stop

🇵🇸
View GitHub Profile
@goto-bus-stop
goto-bus-stop / live.html
Last active August 29, 2015 14:06
ZeroEmpires Stream Viewer Bar
<style>
#percentage-wrap {
position: relative;
height: 1800px;
}
#percentage-background {
top: 0;
left: 0;
background: #f00;

Haal repo binnen met de SSH Clone URL, als het goed is staan je remotes meteen goed.

$ git clone git@github.com:IcyPalm/Vossen-en-Konijnen.git

Staan je remotes niet goed, dan doe je ook nog:

$ git remote add origin git@github.com:IcyPalm/Vossen-en-Konijnen.git
@goto-bus-stop
goto-bus-stop / soft-rm.sh
Created February 4, 2015 15:58
soft-rm: `rm` wrapper with trash (incomplete)
#!/bin/bash
# gets the full path to a given file
# used for turning cli arguments into absolute paths
softrm_fullpath() {
echo $(cd $(dirname "$1") && pwd -P)/$(basename "$1")
}
# gets the trash directory
softrm_trashdir() {
const cp = require('child_process')
let r = 0, g = 0.5, b = 0.4
setInterval(() => {
r += Math.random()
g += Math.random() * 2
b += Math.random() * 3
r %= 10, g %= 10, b %= 10
cp.spawn('xgamma', [ '-rgamma', (Math.round(r) / 10), '-bgamma', (Math.round(b) / 10), '-ggamma', (Math.round(g) / 10) ])
@goto-bus-stop
goto-bus-stop / server.js
Created August 27, 2015 15:41
fake plug.dj ban image generator
var Canvas = require('canvas')
var http = require('http')
var PORT = 8088
// stolen from http://www.html5canvastutorials.com/tutorials/html5-canvas-wrap-text-tutorial/
function wrapText(context, text, x, y, maxWidth, lineHeight) {
var words = text.split(' ')
var line = ''
var wrapped = false
@goto-bus-stop
goto-bus-stop / getSocket.js
Created September 1, 2015 20:20
Get the live plug.dj WebSocket instance.
var currentUser = plugModules.require('plug/models/currentUser');
var currentRoom = plugModules.require('plug/models/currentRoom');
var chatFacade = plugModules.require('plug/facades/chatFacade');
var CHAT_INTERCEPT_STRING = 'ExtPlug socket patching thing\n\n';
function getSocket() {
// gives the user all permissions client-side temporarily, also avoiding
// mutes and slow modes in the process.
var originalUser = currentUser.toJSON();
@goto-bus-stop
goto-bus-stop / get-rcs.sh
Created September 21, 2015 19:24
RCS deobf
#!/bin/sh
mkdir rcs/$(date '+%m%d')
curl https://code.radiant.dj/rs.min.js -o rcs/$(date '+%m%d')/rs.min.js
node unobfuscate rcs/$(date '+%m%d')/rs.min.js
@goto-bus-stop
goto-bus-stop / make-screenshot
Created February 1, 2017 09:16
Screenshot + upload to ipfs. Usage: `screenshot-ipfs`
#!/bin/sh
OUTPUT_FOLDER=~/Pictures/scrs
TMP_FILE=/tmp/screenshot.png
# Get size by letting user draw a rectangle with `slop`
size=$(slop)
[ $? = 0 ] || exit 1; # Exit if drawing was cancelled.
eval $size
@goto-bus-stop
goto-bus-stop / microplug.js
Last active May 25, 2017 17:19
miniplug, but minified using babili.
import{EventEmitter as a}from'events';import b from'debug';import c from'create-error-class';import d from'bluebird';import{unescape as e}from'plug-message-split';import f from'got';import g from'plug-login';import h from'plug-socket';function i(a){return(b=[]).concat.apply(b,a);var b}function j(a,b){return void 0===b&&(b='id'),'object'==typeof a?a[b]:a}function k(a,b){void 0===b&&(b='id');const c=Array.isArray(medias)?medias:[medias];return c.map((a)=>j(a,b))}function l(a){return new Date(`${a} UTC`)}function m(a){for(var b=[],c=arguments.length-1;0<c--;)b[c]=arguments[c+1];return function(){for(var c=[],d=arguments.length;d--;)c[d]=arguments[d];return a.apply(void 0,b.concat(c))}}const n={NONE:0,DJ:1,BOUNCER:2,MANAGER:3,COHOST:4,HOST:5,AMBASSADOR:3,ADMIN:5},o={YOUTUBE:1,SOUNDCLOUD:2},p={HOUR:'h',DAY:'d',PERMA:'f'},q={SPAMMING:1,VERBAL_ABUSE:2,OFFENSIVE_PLAYS:3,GENRE:4,ATTITUDE:5},r={SHORT:'s',MEDIUM:'m',LONG:'l'},s={VIOLATING_RULES:1,VERBAL_ABUSE:2,SPAMMING:3,LANGUAGE:4,ATTITUDE:5};var t=Object.freeze({ROLE

The header format changed quite significantly in 4.8+. Here's what I have so far. Mostly found by comparing headers to the Sync Logs generated by HD Edition, which log game settings & more (SteamApps/common/Age2HD/Logs/%date%/SyncLog GameType etc.txt). Still lots of unknowns :'

struct aoe2recordHeader50 {
  float thousandSomething; // I've seen 1000, 1004, 1005, not sure what for.
  int thousand;
    /* Relevant strings for this space, not sure how they work yet:
      &mrefDlcOptions
      &refGameDataSet
    */