Skip to content

Instantly share code, notes, and snippets.

View tonetheman's full-sized avatar

Tony Colston tonetheman

View GitHub Profile
@tonetheman
tonetheman / websocketserver.py
Created August 3, 2011 00:23 — forked from mumrah/websocketserver.py
Simple WebSockets in Python
import time
import struct
import socket
import hashlib
import sys
from select import select
import re
import logging
from threading import Thread
import signal
(ns test-clj-byte-chunk-seq
(:import (java.io InputStream OutputStream
FileInputStream FileOutputStream)))
(set! *warn-on-reflection* true)
(def ^:const ONE_MEG (* 1024 1024))
(deftype ByteArrayChunk [^bytes array ^int offset ^int end]
clojure.lang.IChunk
-- Author: Michael-Keith Bernard
-- Date: August 10, 2012
--
-- Notes: This Trie implementation is a port of the Clojure implementation
-- below. I had to implement quite a few functions from clojure.core to keep the
-- same basic functionality. Probably very little if any of this code is
-- production worthy, but it's interesting all the same. Finally, all of the
-- documentation strings are pulled directly from clojure.core and may not
-- accurately reflect the Lua implementation.
--
"""
$ pip install opml
$ python opml_to_markdown.py some_outline.opml
-> some_outline.md
"""
import codecs
import opml
import sys
The Challenge
-------------
Given the following riddle, write a regular expression describing all possible answers,
assuming you never make a move which simply undoes the last one you made.
The Riddle
----------
You are on your way somewhere, taking with you your cabbage, goat, and wolf, as always.
You come upon a river and are compelled to cross it, but you can only carry one of the
three animals at a time. None of whom can swim because this isn't THAT kind of riddle.
@tonetheman
tonetheman / spectrogram.py
Created September 28, 2015 14:32 — forked from maurisvh/spectrogram.py
ANSI art spectrogram viewer that reads audio from a microphone
#!/usr/bin/python
import numpy
import pyaudio
import re
import sys
WIDTH = 79
BOOST = 1.0
@tonetheman
tonetheman / compact.cpp
Created December 30, 2015 18:58 — forked from Wunkolo/compact.cpp
Ascii Raymarcher
#include <math.h>
#include <algorithm>
#include <string>
#include <pmmintrin.h>
using namespace std;typedef float R;
#define _W 79
#define _H 39
#define EP 0.01f
#define OP operator
#define C const
@tonetheman
tonetheman / win32.go
Created June 23, 2016 19:53 — forked from nathan-osman/win32.go
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@tonetheman
tonetheman / MortgageMath.md
Last active August 16, 2016 23:29 — forked from pathikrit/MortgageMath.md
Mortgage Math

Input

p := 100000
apr := 3.0
t := 30

Calcuation:

r := apr/100/12                    # monthly interest rate
@tonetheman
tonetheman / reclaimWindows10.ps1
Created January 7, 2017 18:33 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1