Skip to content

Instantly share code, notes, and snippets.

🤠
It's great in Phoenix 🚲

Dave Tapley dukedave

🤠
It's great in Phoenix 🚲
Block or report user

Report or block dukedave

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
View keybase.md

Keybase proof

I hereby claim:

  • I am dukedave on github.
  • I am dukedave (https://keybase.io/dukedave) on keybase.
  • I have a public key ASDIrQmt-uAMZH32h-lsWcVEvO-Jv8tiDLW_d2KvXMh_FAo

To claim this, I am signing this object:

View imagine.png.txt
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAALuCAMAAADGw2P4AAADAFBMVEWhnZbk5OJxbGG0sau7ubOuq6TBvrmkoZrDwbz5+fnc29ivlTHLycV6dmv29fX5/P+cmZHS0c30+f+BfXNuaV2dzv/s9f+RjYSBl0fi4d92al//1dXk8f/x+P/+3l2enHKOsz2ZlY2k0f/UrhuVkonV1NDV6v+JhXyJpkLp9P//mZmh0P/+uLjM5v/c7f/E4v//qqq12Wz/x8e83f97iE202f+rfHXTioas1f/z8vH9/fzh8P/u7uyx2P+p1P/Z7P+o01LS6f/39/d1cGV1fFLG4o7J5P+53P/QzsvB4P/GpiPW6q3a2da6gXyLfEewrqf/zADhuBKUdGz8+/uOioHf3tvf7/99eG7OzMjGhoHo6Obv9//+1zi/3/+bzf/q6ej/8LKKcWfY1tPsk5H/6IuGgnhrZlqopZ73+//8/v+ZzP/////IxsL/8/P/99XGxL/zlZT/6uqEf3Xx8e//9MZsZ1v/4ODs7Oq7nym4trD8/f+Vwjfo89H19PPqvg28zIqMiH6diTx/bWN/enDg8MLH1IWft2iTj4eXp2vKqqb/+eD0xQerqKHlkI6eeHDeu7iliYG2s63/oaH/0h+gz0Hf6cuotoL2+PrpysjwwgndjYrP5/9/dE78ygLRtUXX6//n8//0+en5l5fp7/Tw+OLXm5iav019cmaEhWGKl1+lq4r8mJjSyBd7e2H//PySvTn/++r4zR/b5vG/ko2YyjTswx+bzTdxbFecnYqZyzP6yQPvmpmuuo+lpJH/zxD9/fb/nJysqpzw3t39/vuZzDOXxzWwnJWNjXT/zQWXmYPw8vWzuJ3y9vnq8vqKhnTjoZ7V4+/t8vjm8fuRkXT7zAPwoaD+/v7+//94c2jv7+7n5uT9/v/s6+q+vLen0/+fz/+32//H4/+v1/9waFv7mJf5yAT//v73xgWrrq7e4M75/PLu9dvzzA
View learning_violin.md

Before we get started, the violinist subreddit is a fun place to hang out, lots of good questions and other beginners!

I've ended up taking something like a 4 pronged approach, I try to do at least an hour of each twice a week:

Music theory

@dukedave
dukedave / codeclimate-test-reporter.rb
Created Jul 5, 2016
CodeClimate::TestReporter patched to handle the absence of a .git
View codeclimate-test-reporter.rb
require 'simplecov'
require 'codeclimate-test-reporter'
module Extensions
module Git
module ClassMethods
def info
{
head: head,
committed_at: committed_at_or_now,
@dukedave
dukedave / 0_select_duration.rb
Last active Feb 13, 2016
ActiveSupport::Duration in select
View 0_select_duration.rb
>> @store.start_of_day == 0.hours
=> true
>> options_for_select([['foo', 0.hours]], @store.start_of_day)
=> "<option value=\"0\">foo</option>"
>> options_for_select([['foo', 0.hours]], 0.hours)
=> "<option selected=\"selected\" value=\"0\">foo</option>"
@dukedave
dukedave / page.css
Created Feb 1, 2016
Custom print DOM
View page.css
@media print {
body>:not(.printme) {
display: none;
}
}
@media not print{
.printme {
display: none;
}
@dukedave
dukedave / warn_legacy.rb
Last active Nov 16, 2015
Notify Sentry when legacy attributes are used
View warn_legacy.rb
LEGACY_PROCESSOR_ATTRS.each do |*attr|
define_method(attr) do
Raven.capture_message "Read legacy attribute #{attr}", level: 'warning'
read_attribute attr, *opts
end
define_method("#{attr}=") do |*opts|
Raven.capture_message "Wrote legacy attribute #{attr}", level: 'warning'
write_attribute attr, *opts
end
@dukedave
dukedave / .ackrc
Created Nov 10, 2015
Dave's ack config
View .ackrc
--type-set=coffee=.coffee
--type-set=haml=.haml
--type-set=sass=.sass
--type-set=minifiedjs=.min.js
--nocss
--nominifiedjs
--ignore-dir=coverage
--ignore-dir=dragonfly
--ignore-dir=javascripts/lib
View install-rabbitmq-ubuntu.sh
#!/bin/sh
{
echo "This script requires superuser access to install apt packages."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
@dukedave
dukedave / delegating_decorator.rb
Created Aug 21, 2015
Rails decorator delegation with method missing
View delegating_decorator.rb
class << self
def method_missing(method, *args)
result = (method == :all) ? Account.scoped : Account.send(method, *args)
result.where(something: true).map { |a| self.new a }
rescue NoMethodError => e
if result.is_a? ActiveRecord::Relation
raise e
else
raise NoMethodError.new "Account.#{ method } did not return a relation", method, args
You can’t perform that action at this time.