Skip to content

Instantly share code, notes, and snippets.

View h3h's full-sized avatar

Bradford Fults h3h

View GitHub Profile
@h3h
h3h / .bash_profile
Created June 4, 2012 21:43
My Git Aliases
# awesome git prompt
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUPSTREAM="auto"
export PS1="${WHITE}\$(date +%H:%M) ${CYAN}\w ${RED}\$(~/.rvm/bin/rvm-prompt v)${GREEN}\$(__git_ps1)${WHITE}\$${RESET} "
export TERM="xterm-256color"
# scm stuff
alias gp="git pull"
alias gpu="git push"
@h3h
h3h / gist:4437224
Last active May 3, 2021 15:02
My thoughts on Open Allocation, from Michael O. Church.

Original Post

Evaluating Team Members

If people want to move, and the leads of those projects deem them qualified, there’s no reason not to allow this.

Deeming someone qualified is a pretty nuanced and difficult process. I wouldn’t expect all or even most temporary tech leads to get it right (or even be close) for a long time.

@h3h
h3h / rubify_regexp.rb
Created April 6, 2012 18:38
Perl to Ruby Regular Expression Conversion
POSSIBLE_OPTIONS = "[misxp]"
def rubify_regexp(l)
re = l.gsub(/\(\?(#{POSSIBLE_OPTIONS}*)(?:-(#{POSSIBLE_OPTIONS}*))?:/) do |_|
enabled = $1
disabled = $2
# Perl's `s` option is `m` in Ruby
if enabled.include?('s') && !enabled.include?('m')
enabled.sub!('s', 'm')
else
@h3h
h3h / 01.elm
Last active September 25, 2017 08:06
Elm Tutorial Roll Dice with SVG – Start here: http://elm-lang.org/examples/random
module Main exposing (..)
import Html exposing (..)
import Html.Attributes
import Html.Events exposing (..)
import List
import Random
import Svg exposing (..)
import Svg.Attributes exposing (..)
@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
@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 / 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 / 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 / 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 / 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"
}