Skip to content

Instantly share code, notes, and snippets.

@Warpten
Warpten / board.js
Created July 8, 2012 20:53
Chess over Internet sketch 0.1
(function () {
var Game = (function() {
var Game = function(domElem) {
var objInstance = new Game.fn.init(domElem);
// Append click handler
$(domElem).click(function(eventData) {
Game.fn.onClick(eventData.pageX, eventData.pageY, objInstance);
});
@Warpten
Warpten / board.js
Created July 8, 2012 21:14
Chess over Internet Draft v0.5
(function () {
var Game = (function() {
var Game = function() {
return new Game.fn.init();
};
Game.fn = Game.prototype = {
constructor: Game,
isVerbose: function() { return this._verbose; },
@Warpten
Warpten / gist:3806260
Created September 30, 2012 08:37
Le crash
User@USER-PC /c/Repositories/Sniffs
$ WowPacketParser.exe ruby_sanctum.bin
Loading DB...
Connecting to MySQL server: Server=localhost;Port=3306;Username=root;Database=wpp;CharSet=utf8;ConnectionTimeout=5;
Finished loading DB in 00:00:00.324.
[1/1 ruby_sanctum.bin]: Reading packets...
[1/1 ruby_sanctum.bin]: Parsing 354083 packets. Assumed version V3_3_5a_12340
Processing... 100% complete
@Warpten
Warpten / gist:5543530
Last active December 17, 2015 03:29
MultiLayerCanvas
function Layer(width, height) {
this.width = width;
this.height = height;
this.canvas = document.createElement("canvas");
this.context = this.canvas.getContext("2d");
this.canvas.width = width;
this.canvas.height = height;
this.getCanvas = function() { return this.canvas; };
@@ -432,11 +432,12 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
float basePointsPerLevel = RealPointsPerLevel;
int32 basePoints = bp ? *bp : BasePoints;
float comboDamage = PointsPerComboPoint;
// base amount modification based on spell lvl vs caster lvl
- if (ScalingMultiplier != 0.0f)
+ // Do not perform any scaling calculation if custom values were passed to us
+ if (ScalingMultiplier != 0.0f && !bp)
{
<?php
class EAI
{
private $texts = array();
public function __construct($creatureId, $creatureName)
{
$this->creatureId = $creatureId;
$this->creatureName = $creatureName;
@Warpten
Warpten / zafc74.js
Last active August 29, 2015 13:57
zafc74.js
function d(p){var w={_a:"a1",_i:"a2",_q:"a3",_y:"a4",_G:"a5",_O:"a6",_W:"a7",_4:"a8",_b:"b1",_j:"b2",_r:"b3",_z:"b4",_H:"b5",_P:"b6",_X:"b7",_5:"b8",_c:"c1",_k:"c2",_s:"c3",_A:"c4",_I:"c5",_Q:"c6",_Y:"c7",_6:"c8",_d:"d1",_l:"d2",_t:"d3",_B:"d4",_J:"d5",_R:"d6",_Z:"d7",_7:"d8",_e:"e1",_m:"e2",_u:"e3",_C:"e4",_K:"e5",_S:"e6",_0:"e7",_8:"e8",_f:"f1",_n:"f2",_v:"f3",_D:"f4",_L:"f5",_T:"f6",_1:"f7",_9:"f8",_g:"g1",_o:"g2",_w:"g3",_E:"g4",_M:"g5",_U:"g6",_2:"g7","_!":"g8",_h:"h1",_p:"h2",_x:"h3",_F:"h4",_N:"h5",_V:"h6",_3:"h7","_?":"h8"};var g=p.charAt(0);var b=p.charAt(1);var k=w["_"+g];var x;var c=null;var v=k.charCodeAt(0);var q=null;if(b=="{"){q=v-1;c="q"}else{if(b=="~"){q=v;c="q"}else{if(b=="}"){q=v+1;c="q"}else{if(b=="("){q=v-1;c="n"}else{if(b=="^"){q=v;c="n"}else{if(b==")"){q=v+1;c="n"}else{if(b=="["){q=v-1;c="r"}else{if(b=="_"){q=v;c="r"}else{if(b=="]"){q=v+1;c="r"}else{if(b=="@"){q=v-1;c="b"}else{if(b=="#"){q=v;c="b"}else{if(b=="$"){q=v+1;c="b"}}}}}}}}}}}}if(q!=null){var m=k.charAt(1);if(m==7){x=String.fro
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propnotify</Title>
<Author>Giacomo Pozzoni</Author>
<Description>Poperty with OnPropertyChanged event</Description>
<HelpUrl></HelpUrl>
<SnippetTypes />
<Keywords />
#!/usr/bin/python
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.
# Michael Davis (mike.philip.davis@gmail.com)
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import select
@Warpten
Warpten / chess.js
Created April 18, 2014 14:27
chessjs - The best of both worlds (chess.js and chessboard.js)
;(self || module.exports || window)['ChessBoard'] = function(container, config) {
var CSS = { }, // Css properties
START_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
PAWN = "p",
BISHOP = "b",
KNIGHT = "n",
ROOK = "r",
QUEEN = "q",
KING = "k",
SYMBOLS = "pbnrqkPBNRQK",