Skip to content

Instantly share code, notes, and snippets.

View Wunkolo's full-sized avatar
💻

Wunk Wunkolo

💻
View GitHub Profile
@Wunkolo
Wunkolo / Pi_Approx.cpp
Created February 4, 2015 02:12
Pi Approximation
// Pi approximatization
//http://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80
//Slow conversion...
#include <stdint.h>
#include <stdio.h>
int main()
{
double result = 0;
for( size_t k = 1; k <= 1000000; k++ )
@Wunkolo
Wunkolo / spiral.cpp
Created February 4, 2015 02:03
Spiral generator
//Spirals
//┌─────────┐
//│┌───────┐│
//││┌─────┐││
//│││┌───┐│││
//││││┌─┐││││
//│││││└┘││││
//││││└──┘│││
//│││└────┘││
//││└──────┘│
@Wunkolo
Wunkolo / ARDS.cpp
Last active May 15, 2016 20:37
Action Replay code snippets
// Parse Action Replay DS Code
#include <string>
#include <vector>
#define STR(x) # x
enum Button
{
A = 0xFFFE,
B = 0xFFFD,
@Wunkolo
Wunkolo / ASCIIRayTrace.cpp
Last active June 13, 2021 05:36
Just a fun ASCII raytracer I made one day.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <initializer_list>
#include <thread>
#include <chrono>
@Wunkolo
Wunkolo / FTEX File
Last active August 29, 2015 14:12
010 editor templates for various Fox engine file formats
typedef enum <uint>
{
FTEX_Param = 1, // Found for srm and mtm files
// Each channel acts as material parameter
// R = Ambient Occlusion
// G = Specular Albedo
// B = Roughness
FTEX_Color = 3, // Found for bsm files(albedo texture)
FTEX_Cubemap = 7, // Found for cbm(cubemap) and
@Wunkolo
Wunkolo / SaiPal.cpp
Created October 5, 2014 05:37
SaiPal
#include <windows.h>
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <conio.h>
#include <TlHelp32.h> //GetModuleBase
#pragma pack()
struct Color
{
Color()
@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 = ""
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 / 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>
@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);