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
//-------------------------------------- | |
//--- 010 Editor v8.0 Binary Template | |
// | |
// File: Lithtech REZ File Version 1 | |
// Author: MegaByte | |
// Revision: 1 | |
// Purpose: To understand REZ Files. | |
//-------------------------------------- | |
// TODO: Detect empty areas. | |
// TODO: Identify more parts of the Archive. |
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
/* | |
Goal: To output an ordered array of records distributed into a table/grid with natural numbering top left to bottom then continue counting from next column's top. | |
Author: Liam Mitchell | |
Example: | |
2 columns with 8 records would look like this. | |
Row 0: 0 4 | |
Row 1: 1 5 | |
Row 2: 2 6 |
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
var crc32Previous = crc32(document.body.innerHTML); | |
var notificationPromptedAlready = false; | |
var useAlertInstead = true; | |
var ajaxRefreshTimeout = null; | |
function goReloadAJAX(done, notifyOnChange) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', window.location); | |
xhr.send(null); | |
xhr.onreadystatechange = 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
// This script will connect to the DB and look for potential missing indexes. | |
// Author: Liam Mitchell | |
var db = 'database here'; | |
var async = require('async'); | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
host : 'host here', | |
user : 'username here', |
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
#!/bin/bash | |
# Note, apt-get on Ubuntu seems to be providing an out of date optipng. | |
# Try doing this to install version 0.7.6 | |
# Run optipng -v to see the version you have installed. | |
# wget http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz | |
# tar xvf optipng-0.7.6.tar.gz | |
# cd optipng-0.7.6 | |
# ./configure |
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
//// InhibitWindowsEvents.cpp : Defines the entry point for the console application. | |
//// | |
#define WIN32_LEAN_AND_MEAN // Note: This could use WIN_NT 403 | |
#include <windows.h> | |
#include <stdio.h> | |
HHOOK llMouseHook = NULL; | |
HHOOK llKeyboardHook = NULL; |
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
// ⓪ ⓪ Circled Digit Zero | |
// ① ① Circled Digit One | |
// ② ② Circled Digit Two | |
// ③ ③ Circled Digit Three | |
// ④ ④ Circled Digit Four | |
// ⑤ ⑤ Circled Digit Five | |
// ⑥ ⑥ Circled Digit Six | |
// ⑦ ⑦ Circled Digit Seven | |
// ⑧ ⑧ Circled Digit Eight | |
// ⑨ ⑨ Circled Digit Nine |
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
var fs = require('fs'); | |
var http = require('http'); | |
var forceredownload = false; | |
function downloadFile(url, file, callback, redirect_count, known_size) { | |
console.log('Attempting to download ' + url + ' to ' + file); | |
if (redirect_count) { | |
if (redirect_count > 5) { | |
callback('Max redirects reached', url); | |
return; |
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
// https://en.wikipedia.org/wiki/Standard_52-card_deck | |
function unicodeCard(cardNumber) { | |
// As of Unicode 7.0 playing cards are now represented. Note that the following chart ("Playing Cards", Range: 1F0A0–1F0FF) includes cards from the Tarot Nouveau deck as well as the standard 52-card deck. | |
if (cardNumber < 0 || cardNumber > 56) { throw 'Invalid cardNumber '+cardNumber } | |
cardNumber += 2*Math.max(Math.ceil(cardNumber/14),1); | |
return String.fromCodePoint(127136-2+cardNumber); | |
} | |
function unicodeCardHTMLEncoded(cardNumber) { | |
// As of Unicode 7.0 playing cards are now represented. Note that the following chart ("Playing Cards", Range: 1F0A0–1F0FF) includes cards from the Tarot Nouveau deck as well as the standard 52-card deck. |
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
// A way to compare two floating point numbers for "equality". | |
const EPSILON = 0.00000001; | |
function fEqual(a, b) { | |
return ((a - b) < EPSILON && (b - a) < EPSILON); | |
} | |
// An infamous mistake by rookies is to notice the following. | |
// 0.1 + 0.2 == 0.3 | |
// And think it is a mistake when the language says false. Us humans would just say 0.3. | |
// But because of how float points work in computer you end up with something like 0.30000000000000004. |