Skip to content

Instantly share code, notes, and snippets.

View robert-nix's full-sized avatar

Robert Nix robert-nix

View GitHub Profile
@robert-nix
robert-nix / plot.py
Last active December 22, 2015 20:19
IPython GGtracker Hello, world! plot (hackiness warning)
%pylab inline
import urllib2
import json
json_api_test = urllib2.urlopen("http://api.ggtracker.com/api/v1/matches?game_type=1v1&map_name=Derelict%20Watcher%20TE&race=terran&replay=true&vs_race=zerg&paginate=true&average_league=4&limit=100").read()
json_api_result = json.loads(json_api_test)
json_api_results = json_api_result['collection']
json_result_ids = [res['id'] for res in json_api_results]
@robert-nix
robert-nix / Our.cs
Last active September 27, 2016 16:51
Hack tool to rewrite Hearthstone's Unity3d asset files with a custom assembly/monobehaviour
using System;
using System.IO;
using System.Threading;
using UnityEngine;
public class OurMono : MonoBehaviour
{
StreamWriter log;
Timer t;
@robert-nix
robert-nix / twitchlogger.go
Created May 15, 2013 07:29
My first Golang program; an absolute mess.
package main
import (
"crypto/tls"
"encoding/json"
"flag"
"fmt"
irc "github.com/fluffle/goirc/client"
"labix.org/v2/mgo"
"net/http"
@robert-nix
robert-nix / GenericSort.c
Created March 29, 2013 04:13
V8 Array::sort; -m64 -std=c99 Playing around 100000 length list: ~7ms with -O3, ~16ms without, and about 7 seconds in javascript
int GenericSort(void **list, size_t length, compareFn compare) {
// Compare the list as ptrdiff_t's if no comparator is specified.
if (!compare) {
int basic_compare(void *a, void *b) {
int result = 0;
// Compare as signed
ptrdiff_t aL = (ptrdiff_t)a;
ptrdiff_t bL = (ptrdiff_t)b;
if (aL < bL) {
@robert-nix
robert-nix / dump.cpp
Last active April 21, 2016 21:44
SC2 ids dumper (23260, 24247 offset; 1.5+ only) + ASLR support
/* Dump type ids for Units and Abils. SC2.
*
* Keep it simple: cl dump.cpp Version.lib
* May need to enable LAA if 32 bit.
*/
#include <Windows.h>
#include <psapi.h>
#include <TlHelp32.h>
#include <stdint.h>