Skip to content

Instantly share code, notes, and snippets.

@tuttlem
tuttlem / main.go
Created Sep 27, 2017
REST API Todo
View main.go
package main
import (
"os"
"encoding/json"
"net/http"
"strconv"
"github.com/gorilla/mux"
"github.com/gorilla/handlers"
@tuttlem
tuttlem / blockchain.cpp
Created Aug 15, 2017
Blockchain example
View blockchain.cpp
#include <chrono>
#include <sstream>
#include <string>
#include <memory>
#include <iostream>
#include <cstdlib>
#include "picosha2.h"
class block {
View DoubleBufferDemo.java
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;
View keybase.md

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 Nov 26, 2015
Basic usage of a custom delimiter
View App.java
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 Nov 23, 2015
Prime evaluation with Hadoop Streaming
View mapper.py
#!/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 Jun 30, 2019
Basic MASM32 Boilerplate
View basic.asm
; #########################################################################
.386
.model flat, stdcall
option casemap :none
; #########################################################################
include windows.inc
@tuttlem
tuttlem / lcd.cpp
Created Feb 21, 2015
Double buffer arduino sketch
View lcd.cpp
#include <Wire.h>
#include <LiquidCrystal.h>
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#define LCD_SIZE (LCD_WIDTH * LCD_HEIGHT)
class LCDDoubleBuffer {
View mystify.c
#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 Feb 7, 2015
Ruby Asymmetric Encryption
View enc.rb
#!/usr/bin/env ruby
require 'base64'
require 'openssl'
common = {
:key_length => 4096,
:digest_func => OpenSSL::Digest::SHA256.new
}
You can’t perform that action at this time.