Skip to content

Instantly share code, notes, and snippets.

@mrmekon
mrmekon / keybase.md
Created September 19, 2017 15:50
keybase proof

Keybase proof

I hereby claim:

  • I am mrmekon on github.
  • I am mrmekon (https://keybase.io/mrmekon) on keybase.
  • I have a public key whose fingerprint is 2685 83B6 4786 F50F 8074 56DA 8CED 3A80 D41C 0DCB

To claim this, I am signing this object:

@mrmekon
mrmekon / keybase.md
Created September 19, 2017 15:46
keybase proof

Keybase proof

I hereby claim:

  • I am mrmekon on github.
  • I am mrmekon (https://keybase.io/mrmekon) on keybase.
  • I have a public key ASAw0C2WLtDhdmeIAlPwLXyN8KISfCKBhWqala0Dl6UQFwo

To claim this, I am signing this object:

@mrmekon
mrmekon / fp_profiler.mm
Created May 30, 2013 10:14
Compares the performance of fixed-point vs floating-point arithmetic on iPhone 5 (Apple A6 processor) by evaluating a contrived 'movement update' algorithm over a large array of 'particle' structs. Intended to identify best practices for developing an efficient particle engine. I recommend testing on the device with 'Release' versions, using -O3…
//
// main.m
// fp_profiler
//
// Compares the performance of fixed-point vs floating-point for simple
// "particle engine" movement loops.
//
// Optimized for iPhone 5 (Apple A6 / ARMv7)
//
// Created by Trevor Bentley on 5/29/13.
@mrmekon
mrmekon / analyze.py
Created May 5, 2012 01:35
Markov Chain Employee Performance Review Generator
#!/usr/bin/env python
import string
import random
import sys
import pickle
f = open("employee_review_corpus.txt", "r")
contents = f.read()
f.close()
@mrmekon
mrmekon / whitening.py
Created February 16, 2012 18:55
Data whitening (scrambling) with 9-bit LFSR
import sys
import os
import numpy
import random
import string
import matplotlib.pyplot as plt
#data = numpy.random.bytes(10000000)
data = [random.choice(string.printable) for x in xrange(1000000)]
#data = numpy.random.bytes(100)
@mrmekon
mrmekon / depthdev.py
Created February 10, 2012 21:23
Embedly application puzzle
import urllib2
from xml.etree.ElementTree import XMLParser
import numpy
class DepthCounter:
depthdict = {}
def __init__(self):
self.classdepth = 0
self.depth = 0
self.depthdict = {}
@mrmekon
mrmekon / cancelMessages.clj
Created January 30, 2012 15:19
Cancel all ISS messages in queue
(ns com.trevorbentley.cancelMessages
(:require [http.async.client :as client]
[cheshire.core :as cheshire]))
(def host (if (> (count *command-line-args*) 0)
(first *command-line-args*)
"localhost"))
(def cancelUrl (str "http://" host ":9090/cancelMessage"))
(def activeUrl (str "http://" host ":9090/activeMessages"))
@mrmekon
mrmekon / Makefile
Created January 17, 2012 18:40
Capacitive touch sensor via ADC (no external components)
all: default run
default:
msp430-gcc -I/usr/local/msp430-gcc-4.4.3/msp430/include/ captouch.c -save-temps -mendup-at=main -mmcu=msp430x2111 -Os
run:
mspdebug rf2500 "prog a.out"
dump:
mspdebug rf2500 "md 0x1000 256"
@mrmekon
mrmekon / Makefile
Created January 16, 2012 23:05
MSP430 circuit to measure and trick 1997 Jetta LD Pump
all: default run
default:
msp430-gcc -I/usr/local/msp430-gcc-4.4.3//msp430/include/ ldpump_tester.c -save-temps -mendup-at=main -mmcu=msp430x2111 -Os
run:
mspdebug rf2500 "prog a.out"
dump:
mspdebug rf2500 "md 0x1000 256"
@mrmekon
mrmekon / Makefile
Created January 16, 2012 23:04
MSP430 capacitive touch sensor with ADC and capacitor
all: default run
default:
msp430-gcc -I/usr/local/msp430-gcc-4.4.3/msp430/include/ captouch.c -save-temps -mendup-at=main -mmcu=msp430x2111 -Os
run:
mspdebug rf2500 "prog a.out"
dump:
mspdebug rf2500 "md 0x1000 256"