Skip to content

Instantly share code, notes, and snippets.

View Wunkolo's full-sized avatar
💻

Wunk Wunkolo

💻
View GitHub Profile
@Wunkolo
Wunkolo / Color.cpp
Created July 27, 2012 22:10
Color class
/*
* Color.cpp
*
* Created on: Jun 5, 2012
* Author: DEElekgolo
*/
#include "Color.hpp"
@Wunkolo
Wunkolo / Matrix.hpp
Created August 19, 2012 02:54
Math tools
#pragma once
//Row Major templated matrix class.
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <vector>
#include <stdexcept>
@Wunkolo
Wunkolo / cpu.cpp
Created August 23, 2012 04:37
Get cpu vendor ID x86
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
unsigned int idcmd = 0;
unsigned int EBX_REG=0;
unsigned int EDX_REG=0;
unsigned int ECX_REG=0;
unsigned int EAX_SIZE=0;
@Wunkolo
Wunkolo / Clock.cpp
Created December 20, 2012 03:54
Clock and Time
#include "Clock.h"
//platform specific time implementations.
#if defined(__WIN32) || defined(_WIN32)
//windows
#include <windows.h>
namespace
{
LARGE_INTEGER getFrequency()
@Wunkolo
Wunkolo / Logger.cpp
Created December 23, 2012 20:23
Logger
#include "Logger.h"
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <sstream>
#include <stdarg.h>
void Logger::SetLogFile(const std::string FileName)
{
sFileName = FileName;
@Wunkolo
Wunkolo / Easing.hpp
Last active December 12, 2015 01:48
#pragma once
#include <math.h>
namespace Ease
{
//////////////////////////////////////////////////////////////////////////
//Clamping utils
template <class T>
const T& Clamped(const T& high, const T& low, const T& v)
{
@Wunkolo
Wunkolo / msparp.js
Last active December 24, 2015 03:49
Random scripts to mess around on msparp
var message = ["X","X"];
var count = 25;
var cross = 5;//Number of times to "cross" the helix
var spacemax = 60;
handle = setInterval(function(){
var string = ".".repeat(spacemax);
var strand1 = (Math.sin((i/count)*3.14*cross)*0.5+0.5)*spacemax;
string = string.substring(0,strand1) + message[0] + string.substring(strand1);
@Wunkolo
Wunkolo / FnvHash.hpp
Created October 28, 2013 18:15
Compile-time Fowler–Noll–Vo hash of strings. StringHash("Test").GetHash() will be compiled into an unsigned int hash at compile-time.
template<unsigned int N, unsigned int I>
struct FnvHash
{
inline static unsigned int Hash(const char (&str)[N])
{
return (FnvHash<N,I-1>::Hash(str) ^ str[I-1]) * 16777619u;
}
};
template<unsigned int N>
var gathers = [].slice.call(document.querySelectorAll('input[class="redbutton anybutton"]'));
var main = document.querySelector("#super-container").insertBefore(document.createElement('div'),document.querySelector("#super-container").children[5]);
main.id = "grab";
for (var i = 0; i < gathers.length; i++)
{
var posturl = "main.php?p=gather&action=" + gathers[i].value.toLowerCase();
gathers[i].parentNode = "";
$.ajax({
url: posturl,
type: 'POST',
@Wunkolo
Wunkolo / noise.py
Created June 22, 2014 02:00
HexChat python scripts
import xchat, re, random
import string
__module_name__ = "Noise"
__module_version__ = "1.0.0"
__module_description__ = "Generates random colored string of the length specified"
def RandomWord(Length):
charlist = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&\'()*+,-./:;<=>?@[\]^_`{|}~"
word = ""