Skip to content

Instantly share code, notes, and snippets.

View JustinAiken's full-sized avatar
💎
Rubyin'

Justin Aiken JustinAiken

💎
Rubyin'
View GitHub Profile
@joeytwiddle
joeytwiddle / 1_small_repos_first_please.md
Last active July 23, 2020 21:08
Me complaining about GitHub notification UI v2

This is what I sent to GitHub's feedback form (plus a few edits)

The new notifications page is blocking me from working on small open source projects!

The first thing I want to do is see the projects with the least new notifications. But you have truncated them off the bottom of the list! (The list down the left-hand side.)

With the old UI, I used to immediately scroll to the bottom, and interact with the small projects first, before reading the notifications of larger projects.

Why? Because these small activity projects are more likely to be projects with only a few contributors, where I can make the most impact. Sometimes they are even my own projects. These are usually the projects of most interest to me.

@gavinandresen
gavinandresen / UTXO_Cuckoo.md
Last active June 7, 2021 17:45
Using a cuckoo filter for fast 'unspent?' lookups

A "Cuckoo Filter" is a nifty data structure invented a few years ago; read the paper for details.

Like a Bloom filter, you insert items and then can later ask "does this item exist in the filter?" You'll get either a definite "no" or "yes, probably" with some false-positive error rate. Cuckoo filters have two advantages over Bloom filters:

  1. They are more space efficient at false positive rates less than about 0.03.
  2. You can delete items from them without affecting the false positive rate at all.

It seems to me that an in-memory cuckoo filter could work really well to keep track of Bitcoin's "unspent transaction output set" (UTXO set), to make transaction (or block) validation as fast as possible using minimal memory or disk.

Recall that Bitcoin transactions (other than coinbase transactions that create new coins) have inputs that refer to unspent outputs. An input refers to a previous output by giving the transaction id (a 32-byte hash) co

@tobscher
tobscher / custom_plan.rb
Created January 30, 2013 15:39
Zeus engine setup.
require 'zeus/rails'
ROOT_PATH = File.expand_path(Dir.pwd)
ENV_PATH = File.expand_path('spec/dummy/config/environment', ROOT_PATH)
BOOT_PATH = File.expand_path('spec/dummy/config/boot', ROOT_PATH)
APP_PATH = File.expand_path('spec/dummy/config/application', ROOT_PATH)
ENGINE_ROOT = File.expand_path(Dir.pwd)
ENGINE_PATH = File.expand_path('lib/my_engine/engine', ENGINE_ROOT)
class CustomPlan < Zeus::Rails
@JustinAiken
JustinAiken / facebook_scrape.rb
Created December 4, 2012 22:49
facebook election scraper
require 'koala'
AUTH_TOKEN = ENV["AUTH_TOKEN"]
START_TIME = Date.new(2012,11,5).to_time.to_i
END_TIME = Date.new(2012,11,8).to_time.to_i
@facebook = Koala::Facebook::API.new(AUTH_TOKEN)
friends = @facebook.get_connections("me", "friends").sort_by {|friend| friend["name"]}
friends = friends[161..(friends.count - 1)]