Skip to content

Instantly share code, notes, and snippets.

jart / mtgox.php
Created Mar 12, 2014
Some Mt.Gox Source Code
View mtgox.php
namespace Money;
class Bitcoin {
#const BITCOIN_NODE = ''; // temporary
const BITCOIN_NODE = '';
static private $pending = array();
public static function update() {
jart / gist:c32796c46d5bb5b39a04
Last active Aug 29, 2015
Poetry generated by Poemy2 using comments posted to Reddit by anarchists
View gist:c32796c46d5bb5b39a04
master jart@bean:~/poemy2$ ./poemy --alsologtostderr --foot=trochaic --length=tetrameter --tries=20 --lines=200 --corpora=moonbat --dict=isle 2>/dev/null | python ~/
when the group is largely roiling, even in the war and losing
by the spanish revolution, as a way of distribution
phony claim that israel murders, please just take it for the last years
who is really important, that resulted in a different
only reason that this matters, opposition to the workers
tv has been waiting, listening to the state demanding
prices are a lot of human, here is the initiation
the position here is blaming, here's a bunch of people doing
soldiers know the whole entire, and with all of the oppressor
import select
import socket
class UDPEchoServer(object):
def __init__(self):
self.sock = socket.socket(type=socket.SOCK_DGRAM)
self.sock.bind(('', 5000))
jart / pbkdf2.c
Created Sep 13, 2011
Justine's PBKDF2
View pbkdf2.c
/* gcc -O3 --std=gnu99 -o pbkdf2 pbkdf2.c sha256.c && time ./pbkdf2 password salt 100000 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "sha256.h"
#define DIGEST_SIZE 32
#define BLOCK_SIZE 64
jart / gist:3156709
Created Jul 21, 2012
Assembly Audio Mixing
View gist:3156709
* Represents 20ms of 8khz signed linear 16-bit audio
* This is how much audio gets put in each RTP packet.
typedef int16_t frame_t[160];
* Fast mix two audio frames together on x86 and x86_64
jart /
Created Aug 23, 2012
Gothic Poetry Generator
Gothic Poetry Generator
import sys
jart / gist:3432942
Created Aug 23, 2012
Generated Poetry
View gist:3432942
we really have to plug my eyes before
black angel i feel hunger for the shore
which answered not with a caress he died
shone for me to the lake of the night tide
with sadness here i opened wide the door
that scream i hear the angels name lenore
jart /
Created Aug 24, 2012
Lorem Gotham w/ Rhyming
Gothic Poetry Generator
import marshal
jart / form_errors.html
Last active Dec 11, 2015
An example of how to use Twitter Bootstrap with Django Forms
View form_errors.html
{% for error in form.non_field_errors %}
<div class="alert alert-error">{{ error }}</div>
{% endfor %}
jart / gist:4704095
Created Feb 3, 2013
Google Open Source Libraries for C++ Development
View gist:4704095
* glog - An excellent C++ logging library.
* gtest - An excellent C++ testing library.
* gflags - The best way to make your C++ program accept command line flags, be documented, and configurable all in one fell swoop.
* breakpad - A good multi-platform crash reporting system for C++ apps.
* gperftools - Faster heap memory and a bunch of tools similar to valgrind. Not as well maintained as it should be.
* sparsehash - An awesome hash map container library for both performance and low memory use cases.
* cityhash - Perhaps the best non-crypto hashing algorithm. 2x faster than MurmurHash.
* re2 - A drop-in replacement for PCRE (Perl Compatible Regular Expressions) that doesn't introduce security and performance risks. Most other regex libraries will run potentially boundless operations which can have surprising performance impacts and allow attackers to perform denial of service attacks.