Skip to content

Instantly share code, notes, and snippets.

View h3h's full-sized avatar

Bradford Fults h3h

View GitHub Profile
@h3h
h3h / .gitconfig
Created December 11, 2015 20:26
Git Config
[alias]
amend = commit --amend
co = checkout
st = status
cp = cherry-pick
# edit config (global, local)
ec = !vim ~/.gitconfig
ecl = !vim .git/config
@h3h
h3h / And-I-Explain.md
Last active December 14, 2015 17:59
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: http://www.outlinenone.com/

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

@h3h
h3h / tires.md
Last active December 17, 2015 08:19
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
h3h / Gemfile
Created June 4, 2013 01:05
Austin.RB Kata
source "https://rubygems.org/"
gem 'rack-fiber_pool'
gem 'mysql2'
gem 'activerecord'
gem 'em-synchrony'
gem 'em-http-request'
gem 'grape'
gem 'goliath'
gem 'multi_json'
@h3h
h3h / GitGutter.sublime-settings
Last active December 20, 2015 22:50
Preventing OS X’s aggressive git shim prompt when you don’t have Xcode installed.
{
// Custom path to git binary when not in PATH
"git_binary": "/usr/local/bin/git"
}
@h3h
h3h / foo.rb
Last active December 21, 2015 09:49
Sanitizing HTML content in a Rails model.
class Foo < ActiveRecord::Base
ALLOWED_HTML_ELEMENTS = %w[
a b br blockquote code em h2 h3 hr i li ol p pre s strong sub sup u ul
]
ALLOWED_EMPTY_HTML_ELEMENTS = %w[br hr]
before_validation :sanitize_html
private
@h3h
h3h / adblock.config
Created January 28, 2014 22:37
Adblock Custom Rules for Cleaner GitHub Pull Requests
github.com##div#discussion_bucket div.form-actions div.form-actions-protip
github.com##div#discussion_bucket div.previewable-comment-form p.drag-and-drop
github.com##div#discussion_bucket p.push-more
github.com##div#discussion_bucket span.tabnav-right span.tabnav-widget.text
github.com##div#discussion_bucket div.discussion-timeline div.thread-subscription-status
@h3h
h3h / 0-resume-template.md
Last active July 28, 2016 13:07
Ideal Resume Format for a Software Engineer

https://github.com/[yourname]

Ambition

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

Experience

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

@h3h
h3h / hash.rb
Created March 10, 2011 00:09
Hash#&
class Hash
# Intersection on hash keys (and values) that actually returns a Hash.
# The RHS can be an Array or a Hash.
#
# == Examples:
# >> hsh = {:banana => "elephant", :bar => "foo", :baz => "wuux"}
# >> hsh & [:bar]
# => {:bar=>"foo"}
#
# >> hsh & {:bar => "foo", :baz => "wuux"}
@h3h
h3h / 01.elm
Last active December 18, 2016 06:22
Evolving Elm Validation Code
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
import List
import Regex exposing (regex)
main =
Html.beginnerProgram
{ model = model