Skip to content

Instantly share code, notes, and snippets.

View jszmajda's full-sized avatar

Jess Szmajda jszmajda

View GitHub Profile
jszmajda /
Last active September 3, 2022 18:33
Data Serialization: JSON, MsgPack, ProtoBufs
jszmajda /
Created September 18, 2011 20:22
Game of Life in Erlang

Conway's Game of Life in Erlang, in 2 hours, with 0 Erlang experience, in 20 lines of code.

1337 h4x0rs:

  • @jszmajda
  • @ngauthier
  • @ericoestrich
  • @danivovich
  • @kafuchau
jszmajda / test_http_clients.rb
Created February 10, 2011 22:26
a benchmark to test Net::HTTP, HTTParty, Curb, and system curl
require 'rubygems'
require 'httparty'
require 'curb'
require 'net/http'
require 'benchmark'
include Benchmark
RUNS = 1000
url = 'http://localhost:4567/'
jszmajda / boids.pde
Created September 2, 2019 18:15
Flock flock;
void setup() {
size(1900, 1000);
flock = new Flock();
// Add an initial set of boids into the system
for (int i = 0; i < 1550; i++) {
flock.addBoid(new Boid(random(0, width), random(0, height)));
This file has been truncated, but you can view the full file.
irbx08x08x08vim repos.json x08x08x08x08x08x08x08x08x08x08x08x08x08x08x08hub api orgs/axioscode/repos > repos.json
Jesss-MacBook-Pro:generator-axios jess$ irb
irb(main):001:0> require 'json'
=> true
irb(main):002:0> JSON.parse('repos.sx08x27[Kjson'));nilx27[18Gx27[1@dJx08x27[1@aJx08x27[1@tJx08x27[1@=Jx08
=> nil
irb(main):003:0> dat.keys
NoMethodError: undefined method `keys' for #<Array:0x00007fd1fd8fb7f0>
from (irb):3
from /usr/bin/irb:11:in `<main>'

Keybase proof

I hereby claim:

  • I am jszmajda on github.
  • I am jszmajda ( on keybase.
  • I have a public key whose fingerprint is 31BD 2FD8 F4D2 2B00 BBF1 7FAB 7E77 C933 FF4A 472B

To claim this, I am signing this object:

jszmajda / avro_at_optoro.rb
Created December 18, 2017 16:34
Showing how we're currently using AVRO in Optoro's ruby projects. This is very very much still subject to change!!
# Optoro bits of using Avro. Currently with the AvroTurf, but I'm going to refactor away from that.
# this all sits in a rails repo in `app/message_bus`
# `app/message_bus/message_bus.rb`
module MessageBus
def avro
# Things in the schema folder are `<MessageName>.avsc` files. They're JSON
jszmajda / sample.elm
Last active September 9, 2017 00:33
Elm JSON Decoding
-- So I'm decoding JSON with this pattern, but there has to be a better way
import Json.Decode as JD
type alias User =
{ id : Int
, email : String
, firstName : String
, lastName : String
jszmajda / apocalypse_lullaby.txt
Last active September 2, 2017 03:38
Apocalypse Lullaby Tablature (Tab)
Apocalypse Lullaby by The Wailin' Jennys
This is an open tuning: CFCFAC
I play it mostly strumming all the strings and only muting the very
occasional one on the 4x0230 chord. I'm sure that's not quite right ;)
I wrote this tab based on Hugo Glanville's youtube video:
module Y2017.M06.D07.Exercise where
import qualified Data.List as L
So, here's one of the questions Amazon asks developers to test their under-
standing of data structures.
You have a binary tree of the following structure: