Skip to content

Instantly share code, notes, and snippets.

View robert-nix's full-sized avatar

Robert Nix robert-nix

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
class Program
{
static void Main(string[] args)
{
new Tester().Run();
// A quick and dirty DLL injector
// This method relies on static linkage and the fact that kernel32 doesn't move
// Compile with the same bitness as the target and the dll.
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#include <stdio.h>
int GetPid(char *modName)
{
<?xml version="1.0" encoding="UTF-8"?>
<state
name="State_Burst_Item"
icon=""
passiveeffect=""
effecttype=""
ishidden="true"
lifetime="10000"
[[{"Game":{"CardID":"","ID":1,"__status":null,"Tags":{"ZONE":"PLAY","ENTITY_ID":1,"CARDTYPE":"GAME"}},"Players":[{"ID":1,"GameAccountId":{},"Player":{"CardID":"","ID":2,"__status":null,"Tags":{"HERO_ENTITY":4,"MAXHANDSIZE":10,"STARTHANDSIZE":4,"PLAYER_ID":1,"TEAM_ID":1,"ZONE":"PLAY","CONTROLLER":1,"ENTITY_ID":2,"MAXRESOURCES":10,"CARDTYPE":"PLAYER"}},"CardBackID":0},{"ID":2,"GameAccountId":{},"Player":{"CardID":"","ID":3,"__status":null,"Tags":{"HERO_ENTITY":36,"MAXHANDSIZE":10,"STARTHANDSIZE":4,"PLAYER_ID":2,"TEAM_ID":2,"ZONE":"PLAY","CONTROLLER":2,"ENTITY_ID":3,"MAXRESOURCES":10,"CARDTYPE":"PLAYER"}},"CardBackID":3}],"Type":"CREATE_GAME"},{"Entity":{"CardID":"HERO_07","ID":4,"__status":"Gul'dan (Gul'dan#0)","Tags":{"HEALTH":30,"ZONE":"PLAY","CONTROLLER":1,"ENTITY_ID":4,"FACTION":"NEUTRAL","CARDTYPE":"HERO","RARITY":"FREE"}},"Type":"FULL_ENTITY"},{"Entity":{"CardID":"CS2_056","ID":5,"__status":"Life Tap (Gul'dan#0)","Tags":{"COST":2,"ZONE":"PLAY","CONTROLLER":1,"ENTITY_ID":5,"FACTION":"NEUTRAL","CARDTYPE":"H
@robert-nix
robert-nix / Makefile
Created September 4, 2014 14:04
emscripten makefile
CC=emcc
WOPTS=-Wno-warn-absolute-paths
CFLAGS=-std=c++11 -fno-exceptions -O3 $(WOPTS)
LDFLAGS=
SOURCES=$(wildcard *.cpp */*.cpp)
BCS=$(SOURCES:.cpp=.bc)
EXEC=$(notdir $(shell pwd)).html
all: $(EXEC)
@robert-nix
robert-nix / DungeonJournalItems.json
Last active August 29, 2015 14:05
select itemID, JournalEncounterItem.difficultyMask, JournalEncounterItem.factionMask, JournalEncounter.name_lang as encounterName, JournalInstance.name_lang as instanceName from JournalEncounterItem inner join JournalEncounter on journalEncounterID == JournalEncounter.ID left outer join JournalInstance on journalInstanceID == JournalInstance.ID
This file has been truncated, but you can view the full file.
[
{
"itemID": 2169,
"difficultyMask": 1,
"factionMask": 4294967295,
"encounterName": "Glubtok",
"instanceName": "Deadmines"
},
{
"itemID": 5195,
@robert-nix
robert-nix / enchantItemSpellids.json
Last active August 29, 2015 14:05
select effectItemType as itemID, effectMiscValue_0 as enchantID, spellID from SpellEffect where effect == 53 and effectItemType != 0
{
"enchantItems": [
{
"enchantID": "4720",
"itemID": "38679",
"spellID": "7418"
},
{
"enchantID": "41",
"itemID": "38766",
require('GlobalStrings')
-- generated from s_bonusStatStringTags
local bonusStats = {
[0] = "ITEM_MOD_MANA_SHORT",
[1] = "ITEM_MOD_HEALTH_SHORT",
[3] = "ITEM_MOD_AGILITY_SHORT",
[4] = "ITEM_MOD_STRENGTH_SHORT",
[5] = "ITEM_MOD_INTELLECT_SHORT",
[6] = "ITEM_MOD_SPIRIT_SHORT",
do ->
sm2 = undefined
Object.defineProperty window, 'soundManager',
get: -> sm2
set: (val) ->
sm2 = val
if sm2?
bDI = sm2.beginDelayedInit
sm2.beginDelayedInit = ->
sm2.preferFlash = false
scoreBin = (items) ->
failure = 0
color = {}
type = {}
pattern = {}
for item in items
color[item.color] or= 0
type[item.type] or= 0
pattern[item.pattern] or= 0
color[item.color]++