Skip to content

Instantly share code, notes, and snippets.

Bradford Fults h3h

View GitHub Profile
h3h / yep.rb
Created Aug 10, 2014
Random Plausible HTML Tags
View yep.rb
def random_plausible_html_tags(num=5) { [*('a'..'z')].sample(rand(6) + 1).join }
h3h /
Last active Aug 29, 2015
Adding to/from GeoJSON Conversions to Sequel Queries


INSERT INTO geographies (type, name, geometry)
  'Vintage Heart Coffee',
  ST_GeomFromGeoJSON('{"type": "Point", "coordinates": [30.2642, -97.7277]}')
-- INSERT 0 1
h3h / routes.rb
Last active Aug 29, 2015
Getting the first segments of currently defined static routes
View routes.rb
map { |r| r.optimized_path[1..-1].split('/').first }.
reject { |s| s.include?('*') || s.include?(':') }
h3h / object_attrlist.rb
Last active Aug 29, 2015
Accessing multiple attributes/methods of an object with a concise syntax.
View object_attrlist.rb
module Attrlist
def /(attrlist) { |a| send(a) }
class Time
include Attrlist
h3h / adblock.config
Created Jan 28, 2014
Adblock Custom Rules for Cleaner GitHub Pull Requests
View adblock.config div.form-actions div.form-actions-protip div.previewable-comment-form p.drag-and-drop p.push-more span.tabnav-right span.tabnav-widget.text div.discussion-timeline div.thread-subscription-status
h3h / foo.rb
Last active Dec 21, 2015
Sanitizing HTML content in a Rails model.
View foo.rb
class Foo < ActiveRecord::Base
a b br blockquote code em h2 h3 hr i li ol p pre s strong sub sup u ul
before_validation :sanitize_html
h3h / Gemfile
Created Jun 4, 2013
Austin.RB Kata
View Gemfile
source ""
gem 'rack-fiber_pool'
gem 'mysql2'
gem 'activerecord'
gem 'em-synchrony'
gem 'em-http-request'
gem 'grape'
gem 'goliath'
gem 'multi_json'
h3h /
Last active Jul 28, 2016
Ideal Resume Format for a Software Engineer


[Describe ambitions: type of work, attributes of team, what you want to learn & teach]


[in reverse chronological order, list at most 5 positions or 10 years back, whichever is fewer]

h3h /
Last active Dec 17, 2015
Kicking the Tires

Modifying Programs

When modifying a program, or when reviewing a modification of a program, you will want to consider at least the following:

  1. Tests
  • Is the modification tested?
  • Can you prove that the tests cover both the pre-modification and post-modification states of the program correctly? Do it.
  1. Interface
  • Does the modification change the interface of the code?
  • If so, are all possible callers prepared for the change?
h3h /
Last active Dec 14, 2015
Personal user stylesheet to get rid of focus outlines on non-form elements.

My personal user stylesheet to get rid of focus outlines on non-form elements because I don't personally need them for accessibility.

Don't ever do this in your site's stylesheet because you're putting disabled users at a disadvantage. Do put this in your own user stylesheet if you hate the focus outlines in Gmail, Google Groups and countless other web apps.

See also:

For Chrome on Mac, this goes in ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css

You can’t perform that action at this time.