This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name LiquidGist | |
// @description Turns Github Gist links on TeamLiquid threads into Gist embeds automatically | |
// @author tec27 | |
// @version 0.3 | |
// @include http://www.teamliquid.net/forum/viewmessage.php* | |
// @include http://teamliquid.net/forum/viewmessage.php* | |
// @include http://www.teamliquid.net/forum/postmessage.php | |
// @include http://teamliquid.net/forum/postmessage.php | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3rd attempt at blizzerial parsing. Hopefully this time it will be easy to follow, | |
// easy to test, and fast. Pick 2. :D | |
var Cursorize = require('./cursorize'), | |
BigInteger = require('bigdecimal').BigInteger; | |
var Blizzerial = exports = module.exports = function() { | |
if(!(this instanceof Blizzerial)) return new Blizzerial(); | |
this.chain = []; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nibbler - wrapper for Cursorize that allows for reading things that don't fall on even byte boundaries | |
// (individual bits, reading 5 bits from one byte and 3 bits from the next, etc.) | |
// Yes, this name is a reference to Futurama. And yes, like the character there, this will likely | |
// shit up your program with really valuable functionality! | |
var Nibbler = module.exports = function(curs) { | |
if(!(this instanceof Nibbler)) return new Nibbler(curs); | |
this.curs = curs; | |
this.shifted = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc `pkg-config --libs glib-2.0 gobject-2.0 libxml-2.0` `pkg-config --cflags glib-2.0 libxml-2.0 nss` -I/usr/local/include/libpurple/ -DPURPLE_DISABLE_DEPRECATED nullclient.c -lpurple -lresolv -o nullclient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Drawception Fixes | |
// @description Fixes for some common Drawception issues | |
// @author tec27 | |
// @version 0.1 | |
// @match http://drawception.com/play/* | |
// ==/UserScript== | |
/*jshint laxcomma:true browser:true asi:true*/ | |
var fixes = function($) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.BitSet; | |
public class Euler10 { | |
private static BitSet runSieve(int limit) { | |
BitSet bits = new BitSet(limit+1); | |
int sievingLimit = (int)Math.ceil(Math.sqrt(limit)); | |
for(int n = 2; n <= limit; n = bits.nextClearBit(n+1)) { | |
if(n > sievingLimit) break; // any composites will be past the limit | |
for(int m = n*n; m > n && m <= limit; m += n) { | |
bits.set(m, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.stringify( | |
Array.prototype.slice.call($('.halfbox > li > a > img').map(function(i, img) { | |
var $img = $(img), | |
$link = $img.parent(), | |
host = document.location.protocol + '//' + document.location.host, | |
imgParts = $img.attr('src').split('/'), | |
imgName = imgParts[imgParts.length-1]; | |
return { | |
name: $link.attr('title'), | |
thumb: host + $img.attr('src').replace('/dota2/images/', '/dota2/images/thumb/') + '/68px-' + imgName, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <stdlib.h> | |
#include <string> | |
#include <fstream> | |
#include "../Shared/FuncHook.h" | |
using namespace std; | |
HINSTANCE selfInstance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replaces a single instance of magic_bytes in the function_bytes | |
// Works most efficiently if magic_bytes contains no repeated values, but works fine either way | |
// replacement_bytes is assumed to be the same length as magic_bytes here | |
bool ReplaceMagicBytes(byte* function_bytes, const size_t function_length, const byte* magic_bytes, | |
const size_t magic_bytes_length, const byte* replacement_bytes) { | |
// first we construct a table that says how much to jump ahead/back by for any given byte value | |
int jump_by[256]; | |
// for most values (assuming magic_bytes contains few characters), we can skip | |
// MB_length bytes | |
for(int i = 0; i < 256; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "net_manager.h" | |
#include <Windows.h> | |
#include <assert.h> | |
#include "snp_packets.h" | |
namespace sbat { | |
namespace snp { | |
// TODO(tec27): We need a better way of logging errors from this |
OlderNewer