Skip to content

Instantly share code, notes, and snippets.


Brad Gessler bradgessler

View GitHub Profile
bradgessler /
Created Feb 23, 2021
Sitepress pre-release
gem install sitepress --pre
sitepress new ./site
cd ./site
sitepress server
View csv_definition.rb
require "csv"
class CSVDefinition
attr_reader :definition
def initialize
@definition ||=
def row(name, &block)
View OEmbed Discovery
<link rel="alternate" type="application/json+oembed" href="" title="Dancing Girls! (10-16-09 Vlog #5)" />
<link rel="alternate" type="text/xml+oembed" href="" title="Dancing Girls! (10-16-09 Vlog #5)" />
bradgessler / initializer.rb
Last active Mar 10, 2017
MIddleware for making legacy versions of Internet Explorer (anything below 11) work with rails. I release this code under MIT license.
View initializer.rb
# ./config/initializers/rewrite_ie_header.rb
# Don't forget to include the middleware file! If you have a ./lib/middleware folder in rails
# a `require './lib/middleware/rewrite_ie_header.rb'` should do the trick
# IE has a really stupid accept header, so here we scope its domain of mime-types that it can negotiate, otherwise we'll
# end up with weird bugs where if you hit /mcp/:id, IE will download a .ppt file instead of the .html content.
# Issue documented in more detail at
Rails.application.config.middleware.use RewriteIEAcceptHeader do |ie_mime_types|
bradgessler /
Created Nov 15, 2016
First CLI commands
$ docker run ubuntu /bin/echo 'Hello world'
Hello world
bradgessler / list.hon
Last active Dec 29, 2015
JSON is too verbose for hypermedia APIs. HON (Hypermedia Object Notation) preserves the readability and implicit data structure of JSON while with the addition of line attributes for URL and pagination metadata. From
View list.hon
name: "Todo List",
items(href: '/lists/1203/items', next_href: "/lists/1203/items?page=2"): [
item(href: '/items/1'): {
description: "Pick up pizza",
status: "completed"
item(href: '/items/12'): {
description: "Eat pizza",
status: "non_started"
View a.json
a: {
attributes {
href: 'foo.html'
value: 'Click Here'
View link.json
bradgessler /
Last active Dec 16, 2015
Sketch for a Tilt/Markdown extension that makes it a little easier to add structure to markdown after its rendered.
# How to tie your shoes
<%= toc.each do |id, text| %>
* [<%= text %>](#<%= id %>)
<% end %>
## Unlace them
Gotta make sure its untied before you tie it!
bradgessler /
Last active Dec 16, 2015
Why merge backburner with quebert?

Assessment of Quebert & Backburner to figure out how to merge the two.


  1. Build out an async proxy in place of #async_send so that TTR, delays, and priority can be specified in a cleaner way. This looks something like 3).send(:notify_user) as opposed to the current, :quebert => {delay: 3, pri: 1000})
  2. Quebert supports many back-ends: InProcess, Sync, and Beanstalk. Sync and InProcess were created to aid with testing assertions so that Quebert.backend.queue.should have(1).items is possible. It only needs Beanstalk, so the multiple-backends could be removed for the sake of simplicity. A stub could be provided for peeps that want to assert jobs are thrown on the queue in a test env.
  3. There's a controller layer between the Job and the Backend that communicates using exceptions, which is suppose to deal with multiple backends. Eww. I want to just pass a controller into the job and have it deal.