Skip to content

Instantly share code, notes, and snippets.

@nkreipke
nkreipke / treemeta.cpp
Created August 25, 2015 21:24
C++ Meta-Programming Tree Structure
#include <iostream>
struct Nix {};
template<int val, typename left, typename right>
struct Was
{
using left_type = left;
using right_type = right;
@nkreipke
nkreipke / gist:27028811cbe8d541957a
Last active August 29, 2015 14:16
coreclr Linux Bug
using System;
public static class Program
{
public struct Bug
{
public int a;
public long c;
public int b;
public long d;
@nkreipke
nkreipke / macstickies.rb
Created July 22, 2014 15:59
OS X StickieDatabase extractor to separate RTF files
#!/usr/bin/env ruby -wKU
$stickieIndex = 0
def uniq_index
i = $stickieIndex
$stickieIndex += 1
i
end
class Stickie
@nkreipke
nkreipke / genesis-filewreck.rb
Last active December 31, 2015 05:09
This destroys SEGA Genesis games by writing random bytes over the code.
def randomchar
$rand.rand((0..255)).chr
end
def wreck!(data,iterations)
randrange = Range.new(400,data.length)
iterations.times do |i|
data[$rand.rand(randrange)] = randomchar
end
end
def valforbyte(data,byteindex)