Skip to content

Instantly share code, notes, and snippets.

David Shaffer flanger001

Block or report user

Report or block flanger001

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
flanger001 / development.rb
Last active May 27, 2020
This exists because Paperclip emits a lot of 404 errors if you clone your development db from production. If you do not clone your development db from production, you probably should not use this.
View development.rb
require "middleware/paperclip_middleware"
Rails.application.configure do
# other stuff
flanger001 / gem_update.rb
Last active Apr 30, 2020
Gem update script. Put this in bin/gem_update and chmod +x bin/gem_update. Thanks to
View gem_update.rb
#!/usr/bin/env ruby
require "open3"
puts "Create new branch? (press y to continue)"
print "> "
if gets.chomp.casecmp?("y")
system("git checkout master")
system("git branch -D gems/outdated")
system("git checkout -b gems/outdated")

Adding a new PGP key


I have a key that is currently on two computers. I want to do these things:

  • Create a new key with better security
  • Sign my old key with my new key
  • Revoke my old key
  • Export both keys
flanger001 /
Last active Oct 15, 2018
Babel + Typescript + Webpack resources
View spongebob.rb
class String
def spongebob { |c| rand > 0.5 ? c.swapcase : c }.join
View cycling_background.scss
$animation: MoveBG 100s ease infinite;
body {
background: linear-gradient(240deg,#a24bcf,#4b79cf,#4bc5cf);
background-size: 400% 400%;
-webkit-animation: $animation;
-moz-animation: $animation;
-o-animation: $animation;
animation: $animation;
flanger001 / pre-commit
Last active Oct 18, 2017
Rubcop git hook
View pre-commit
#! /usr/bin/env ruby
if system('bundle exec rubocop')
puts 'Rubocop is pleased.'
puts 'Rubocop demands penance.'
View aliasing.rb
class A
def foo
alias_method :bar, :foo
class B < A
def foo
# An object-oriented breakfast
class Mug(object):
def __init__(self, article):
self.article = article
print('You put a', self.article.get_name().lower(), 'in the mug')
def heat(self, heater, time):
heater.heat(self.article, time)
def get_article(self):

Keybase proof

I hereby claim:

  • I am flanger001 on github.
  • I am flanger001 ( on keybase.
  • I have a public key ASAk-Xk1h0680J2gvJ2DHU3IRBOCPrGN-ejC18u2JN19wgo

To claim this, I am signing this object:

You can’t perform that action at this time.