Skip to content

Instantly share code, notes, and snippets.

Avatar

Brendan Loudermilk bloudermilk

View GitHub Profile
View directional-knife.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View open-ping-tree.yml
# TODO: Generic 500 response here and in Rails
openapi: '3.0.2'
info:
title: Open Lead Specification
version: 'v1.0'
description: >
## Overview
This spec implements a two-phase auction system commonly known as "ping
tree" or "ping post". The purpose of the system is to enable sellers of
@bloudermilk
bloudermilk / weighted_list.rb
Created Jun 8, 2018
Simple Ruby algorithm to generate a weighted list
View weighted_list.rb
# README
#
# To run tests:
# $ ruby weighted_round_robin.rb
# PASS [[0, "a"]] makes []
# PASS [[1, "a"]] makes ["a"]
# PASS [[1, "a"], [2, "b"]] makes ["b", "a", "b"]
# ...
#
# To debug (prints index as ID):
View google_places_search.rb
require "csv"
require "net/http"
require "json"
require "pry"
class String
def super_strip
gsub(/(^\W+|\W+$)/, "")
end
end
View keybase.md

Keybase proof

I hereby claim:

  • I am bloudermilk on github.
  • I am bloudermilk (https://keybase.io/bloudermilk) on keybase.
  • I have a public key whose fingerprint is B54D E33B 3320 0EA7 A7AA 6852 AB19 6B5D 5009 CE58

To claim this, I am signing this object:

@bloudermilk
bloudermilk / gravatar.rb
Created Feb 26, 2016
Test whether or not a user has Gravatar
View gravatar.rb
require "net/http"
class GravatarGenerator
URL_FORMAT = "http://www.gravatar.com/avatar/%s"
LAST_MODIFIED_TEST_STRING = "Wed, 11 Jan 1984 08:00:00 GMT"
def self.test(email)
url = URI(URL_FORMAT % generate(email))
Net::HTTP.start(url.host, url.port) do |http|
@bloudermilk
bloudermilk / vancouver-to-sf-tour-pack-list.md
Last active Mar 21, 2018
Pack List for my Vancouver to San Francisco Pacific Coast tour
View vancouver-to-sf-tour-pack-list.md

To Do

  • Buy missing items
  • Test pack

Essentials

  • Phone
  • Wallet
  • Keys
@bloudermilk
bloudermilk / yield.rb
Last active Aug 29, 2015
Example of yield in ruby
View yield.rb
def my_fancy_method
# Call the block with 1
yield 1
# Call the block with "cat"
yield "cat"
# Call the block with nothing (i.e. nil)
yield
end
View sums
def input_get
input = gets.chomp
sum[i] = input.to_i
end
def sum
sum = []
i = 0
puts input_get
View bloudermilk.json
[
{
"repo":{
"id":11757750,
"owner":"facebook",
"name":"huxley",
"url":"https://github.com/facebook/huxley",
"homepage":null,
"language":"Python",
"description":"Watches you browse, takes screenshots, tells you when they change."