Skip to content

Instantly share code, notes, and snippets.

@tuttlem
tuttlem / main.go
Created September 27, 2017 14:46
REST API Todo
package main
import (
"os"
"encoding/json"
"net/http"
"strconv"
"github.com/gorilla/mux"
"github.com/gorilla/handlers"
@tuttlem
tuttlem / blockchain.cpp
Created August 15, 2017 13:25
Blockchain example
#include <chrono>
#include <sstream>
#include <string>
#include <memory>
#include <iostream>
#include <cstdlib>
#include "picosha2.h"
class block {
@tuttlem
tuttlem / DoubleBufferDemo.java
Created March 19, 2017 08:17
Basic Rendering Code
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.awt.image.BufferStrategy;
import java.util.Timer;
import java.util.TimerTask;

Keybase proof

I hereby claim:

  • I am tuttlem on github.
  • I am tuttlem (https://keybase.io/tuttlem) on keybase.
  • I have a public key whose fingerprint is 4E3E ED83 4041 0AAD 58FC B89C 692A EBE9 0953 9D86

To claim this, I am signing this object:

@tuttlem
tuttlem / App.java
Created November 26, 2015 02:22
Basic usage of a custom delimiter
package org.test.customformat;
import java.io.IOException;
import java.util.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
@tuttlem
tuttlem / mapper.py
Created November 23, 2015 10:53
Prime evaluation with Hadoop Streaming
#!/usr/bin/env python
import sys
import itertools
from math import sqrt
def read_input(file):
for line in file:
# ensure that the newline is taken out of the equation
snums = line.replace('\n', '').split(',')
@tuttlem
tuttlem / basic.asm
Last active June 30, 2019 14:17
Basic MASM32 Boilerplate
; #########################################################################
.386
.model flat, stdcall
option casemap :none
; #########################################################################
include windows.inc
@tuttlem
tuttlem / lcd.cpp
Created February 21, 2015 15:07
Double buffer arduino sketch
#include <Wire.h>
#include <LiquidCrystal.h>
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#define LCD_SIZE (LCD_WIDTH * LCD_HEIGHT)
class LCDDoubleBuffer {
@tuttlem
tuttlem / mystify.c
Created February 8, 2015 13:45
Mystify
#include <stdlib.h>
#include <cairo/cairo.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#define N_VERTS 5
#define WIN_WIDTH 1024
@tuttlem
tuttlem / enc.rb
Created February 7, 2015 13:18
Ruby Asymmetric Encryption
#!/usr/bin/env ruby
require 'base64'
require 'openssl'
common = {
:key_length => 4096,
:digest_func => OpenSSL::Digest::SHA256.new
}