Skip to content

Instantly share code, notes, and snippets.

View tauzen's full-sized avatar

Krzysztof Mioduszewski tauzen

View GitHub Profile
@tauzen
tauzen / pocket-dump.csv
Last active August 13, 2025 20:56
Dump of my pocket (getpocket.com) saves
We can't make this file beautiful and searchable because it's too large.
title,url,time_added,tags,status
How to Write a Spelling Corrector,http://norvig.com/spell-correct.html,1609630442,autocorrect|nlp,archive
Inversion of Control Containers and the Dependency Injection pattern,https://martinfowler.com/articles/injection.html,1512920634,,unread
http://www.paulgraham.com/love.html,http://www.paulgraham.com/love.html,1578757239,,archive
Bit Twiddling Hacks,http://graphics.stanford.edu/~seander/bithacks.html,1406811496,,unread
q-gears.sourceforge.net/gears.pdf,http://q-gears.sourceforge.net/gears.pdf,1359970000,,archive
Addressing Doubts about REST,https://www.infoq.com/articles/tilkov-rest-doubts,1494443778,,unread
"What every programmer should know about memory, Part 1 [LWN.net]",http://lwn.net/Articles/250967/,1322403060,,unread
Stevey's Blog Rants: Portrait of a N00b,http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html,1321196597,,archive
Evidence Based Scheduling - Joel on Software,http://www.joelonsoftware.com/items/2007/10/26.html,1455320956,,unread
@tauzen
tauzen / barber.clj
Created July 27, 2019 18:57
7 languages in 7 weeks, Clojure day 3, sleeping barber
(def cut-count (atom 0))
(def client-count (atom 0))
(def cutting (atom false))
(def client-approaching (atom false))
(def client-queue (atom []))
(defn cut [client-id]
(reset! cutting true)
(future
@tauzen
tauzen / money.py
Last active May 5, 2024 17:23
Python DDD - Value Object idea. Immutable attributes, methods, structural equality.
from collections import namedtuple
class Money(namedtuple('Money', ['amount', 'currency'])):
def add(self, amount):
return Money(self.amount + amount, self.currency)
m = Money(20, 'USD')
print(m)
# Money(amount=20, currency='USD')
@tauzen
tauzen / keybase.md
Created July 30, 2016 20:56
keybase.md

Keybase proof

I hereby claim:

  • I am tauzen on github.
  • I am tauzen (https://keybase.io/tauzen) on keybase.
  • I have a public key whose fingerprint is 6F3E 6BAF 57AD 3CE1 97B1 FE0B C429 5266 1A58 88BD

To claim this, I am signing this object:

@tauzen
tauzen / openssl
Last active March 26, 2017 20:44
openssl keys and cert generation, signed digest generation, verification of signed digest
# Creating a RSA private key
$ openssl genrsa -out rsaprivkey.pem 1024
# Creating a cert file from priv key
$ openssl req -new -x509 -key rsaprivkey.pem -out rsacert.pem
# Converting from PEM to DER
$ openssl x509 -outform der -in rsacert.pem -out rsacert.der
# Convertin from DER to PEM
@tauzen
tauzen / joinUint8Arrays.js
Created October 28, 2014 12:06
Joins multiple Uint8Arrays (or regular Arrays) passed as arguments into one combined Uint8Array.
function joinUint8Arrays() {
var args = Array.prototype.slice.call(arguments);
var length = args.reduce(function(a, b) { return a + b.length; }, 0);
var out = new Uint8Array(length);
args.reduce(function(previousLen, buffer) {
out.set(buffer, previousLen);
return previousLen + buffer.length;
}, 0);
@tauzen
tauzen / hexstring.js
Last active September 9, 2024 18:13
Hex string to byte and other way round conversion functions.
function byteToHexString(uint8arr) {
if (!uint8arr) {
return '';
}
var hexStr = '';
for (var i = 0; i < uint8arr.length; i++) {
var hex = (uint8arr[i] & 0xff).toString(16);
hex = (hex.length === 1) ? '0' + hex : hex;
hexStr += hex;
@tauzen
tauzen / app.js
Last active August 29, 2015 14:07
FirefoxOS tag writing example, requires NFC capable device running FirefoxOS 2.1. App needs to be certified! Privileged APIs comming soon!
window.addEventListener('DOMContentLoaded', function() {
'use strict';
console.log('DOMContentLoaded, checking for NFC');
if (!navigator.mozNfc) {
console.log('NFC not available');
return;
}
navigator.mozSetMessageHandler('activity', (activity) => {
@tauzen
tauzen / debug_all.sh
Last active August 29, 2015 14:05
Setting NFC debug_all = true without gecko rebuild
$ adb remount
$ adb pull /system/b2g/omni.ja
$ unzip omni.ja -d Omni
$ sed -i 's/this.DEBUG_ALL = false;/this.DEBUG_ALL = true;/g' Omni/modules/nfc_consts.js
$ cd Omni
$ zip -r omni.ja *
$ adb push omni.ja /system/b2g
$ adb reboot
@tauzen
tauzen / acl.conf.xml
Created March 29, 2014 11:24
Domains ACL definition in freeswitch/conf/autoload_configs/acl.conf.xml with static gw address.
<list name="domains" default="deny">
<node type="allow" domain="$${domain}"/>
<node type="allow" cidr="192.168.0.2/32"/>
</list>