One Time Pad in Elixir

Recently I have been very interested in learning about cryptography. I just finished Crypto by Steven Levy which gives a great background to the crypto field and the advances that enabled the current 'Crypto Craze'. I am also working my way through the Stanford Cryptography Course on Coursera which dives deep on some implementations. Given all that, I thought it would be fun to put some of the ideas...

Read More
Fantasy Football GroupMe Stats

Two years of Fantasy Football conversation in a GroupMe chat visualized using my GroupMe Stats script and Circos. GroupMe is a messaging application where users can 'Like' other messages. My friends use this to like funny, clever, relevant, etc posts. This has lead to some interesting data over the years.


Posts Liked By Member

Chord Chart

This chord chart shows 'likes' given and received by each...

Read More
Rubocop Pre Commit Hook With Pipes

We use RuboCop to check our code for style on each push to Github. I was tired of having builds fail because I forgot to run rubocop so I want a little git pre-commit hook to prevent that from happening.

#!/bin/sh
# This would go in your .git/hooks/pre-commit file

if command -v rubocop > /dev/null; then
  rubocop
fi

That takes too long. Lets use pipes to only run RuboCop on files that have actually...

Read More
Finding Circular References in Postgres

Circular references are rarely a good thing, especially in software. I was recently tasked with preventing circular references in a system where users are tied to other users as managers. We were running into an endless loop where user1 would have user2 as their manager, user2 would have user3 as their manager, and user3 would have user1 as their manager. This means when you try to traverse up the...

Read More
Favorite Books of 2016

This week I read about Bill Gates' favorite books of 2016 and decided that I would like to give my favorite books of the year as well. I think even if nobody else finds this interesting, it is a good snapshot into my mind that I'm sure I'll fondly look back on one day. For my first iteration of this, I will give 4 books that stuck out to me this year. Pretty much all of them are 'classics', but...

Read More
Fast Search Indexing

Here at DoneSafe, we allow users to search for other users when entering forms to select things like, who reported an incident, who was involved, etc. We have received some complaints that the performance of this was slow, and did not allow partial matching. In this post we will explore a couple different strategies on reimplementing this search. We end up implementing a GIN index using Postgres...

Read More
Advantage 2 Keyboard

On Wednesday of this week I purchased a new Advantage 2 Keyboard from Kinesis . It is not a cheap keyboard, nor has it been easy adjusting to the new layout, but I think in the long run it will be well worth it. The key for me is the ergonomics of the keyboard. I have a bad right wrist because of some prior injuries, and while I don't yet have a whole lot of pain typing, I sometimes feel it after...

Read More
Tips for psql

I spend a lot of time in psql. Before becoming a developer I was in business intelligence, where I spent much of my days writing queries, and pulling data from psql. After switching to rails I still find it much easier to check out data and play with queries via psql directly rather than using the rails console. Here are a few tips and tricks that may be common knowledge to some, but I wish I had...

Read More
Binary Search Trees

There's nothing like implementing some data structures on a Friday night! In my ongoing pursuit of shoring up my CS basics, I decided to take some time tonight reading up on Binary Search Trees, as many interview gotchas that I hear of seem to involve them. This is a fairly simple implementation with only the size, get, and put methods, but its a start.

class BinarySearchTree

  attr_reader :root

Read More
GroupMe Stats

My friends from college and I all stay in touch by using the popular messaging app, GroupMe. We have one main group, and then a number of smaller groups for things like fantasy football, investing, etc.. After talking with a friend one day, I thought it would be fun to create a CLI app that pulls stats down and crunches some numbers by using the GroupMe API. An afternoon later I had a nice working...

Read More
Linked Lists

A linked list is a series of nodes that contain two things each, a value, and a reference to the next node in the list. The first node in a linked list will reference the second node, the second will reference the third, all the way until node n, which is the last node, which references NIL. If this sounds a lot like recursion, then you are on the right track. Linked Lists are known as recursive...

Read More