Skip to content

Instantly share code, notes, and snippets.

View dhoffmann's full-sized avatar

Daniel Hoffmann dhoffmann

View GitHub Profile
@dhoffmann
dhoffmann / keybase.md
Created February 20, 2018 18:37
keybase.md

Keybase proof

I hereby claim:

  • I am dhoffmann on github.
  • I am dhoffmann (https://keybase.io/dhoffmann) on keybase.
  • I have a public key ASDuvR-hij3I1F_N6HmeXUmkt0uscpxfpfyr9-AKP24ZmQo

To claim this, I am signing this object:

@dhoffmann
dhoffmann / dropkick.sh
Created January 14, 2016 05:59
dropkick.sh
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
@dhoffmann
dhoffmann / isOnScreen.js
Created April 17, 2015 18:13
ad impression tracking
function isOnScreen(el) {
var obj = el.get(0);
var bounds = obj.getBoundingClientRect();
var half = bounds.height / 2;
var onScreen = ((bounds.top + half) < window.innerHeight) && ((bounds.bottom + half) > 0);
return onScreen;
}
@dhoffmann
dhoffmann / field_errors_spec.rb
Created July 30, 2014 15:45
Testing field_error_proc
require "spec_helper"
describe "field_error_proc" do
describe "without an existing class" do
let(:view_proc) { ActionView::Base.field_error_proc }
let(:instance) { double }
let(:html_string) { '<label for="name">Name</label>' }
it "sets error class" do
@dhoffmann
dhoffmann / gist:8656796
Last active January 4, 2016 17:49
.bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# ALIASES FTW
alias ll='ls -Fla'
alias b='bundle'
alias be='bundle exec'
alias bed='bundle exec deploy'
alias bedable='bundle exec deployable'
alias silent-deploy='cap staging2 deploy:upload FILES=app/path/to/file/you/keep/changing.rb'
alias bepr='bundle exec pull-request'