Skip to content

Instantly share code, notes, and snippets.

View flanger001's full-sized avatar
🧱

David Shaffer flanger001

🧱
View GitHub Profile
@flanger001
flanger001 / btw.md
Last active October 15, 2018 02:03
Babel + Typescript + Webpack resources
class String
def spongebob
each_char.map { |c| rand > 0.5 ? c.swapcase : c }.join
end
end
class String
def rotate_vowels(num = 1)
vowels = "aeiou"
uc_vowels = vowels.upcase
tr(uc_vowels, uc_vowels.chars.rotate(num).join).tr(vowels, vowels.chars.rotate(num).join)
end
end
str = "Hey, I'm gonna need you to come in on Saturday."
str.rotate_vowels
$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
flanger001 / pre-commit
Last active October 18, 2017 22:46
Rubcop git hook
#! /usr/bin/env ruby
if system('bundle exec rubocop')
puts 'Rubocop is pleased.'
else
puts 'Rubocop demands penance.'
exit(1)
end
# Now more objecty
class PotOfCoffee
attr_reader :scoops
def initialize(quantity: 12, strength: :normal)
@quantity = quantity
@strength = strength
end
class A
def foo
'hello'
end
alias_method :bar, :foo
end
class B < A
def foo
'bye'
@flanger001
flanger001 / breakfast.py
Last active April 4, 2017 13:35
Eggs in a mug
# 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 (https://keybase.io/flanger001) on keybase.
  • I have a public key ASAk-Xk1h0680J2gvJ2DHU3IRBOCPrGN-ejC18u2JN19wgo

To claim this, I am signing this object:

@flanger001
flanger001 / Fan Mail.md
Last active January 23, 2017 03:01
This is my bucket list that I accidentally wrote one day. I say "accidentally" because I didn't set out to write a bucket list, that's just what it became.
  • Mark Hamill - P.O. Box 287, Grand Blanc, MI 48480, USA
  • Harrison Ford - P.O. Box 49344, Los Angeles, CA 90049-0344, USA
  • Dave Grohl -
  • Josh Freese - Rebel Waltz, Inc., 31652 2nd Avenue, Laguna Beach, CA 92651, USA
  • Tom Hanks - Playtone, P.O. Box 7340, Santa Monica, CA 90406-7340, USA
  • Bill Murray - Ziffren, Brittenham, 1801 Century Park West, Los Angeles, CA 90067-6406, USA
  • Dan Akroyd - Applied Action Research Corp., 859 Hollywood Way, Box 497, Burbank, CA 91505, USA
  • John Cleese - Phil McIntyre Management Ltd., 3rd Floor, 85 Newman Street, London, W1T 3EU, UK