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 / .tmux.conf
Created Jan 27, 2014
My tmux configuration
View .tmux.conf
# use ctrl-a as the prefix (instead of the default ctrl-b)
set-option -g prefix C-a
# pres ctrl-a, ctrl-a to flip between windows
bind-key C-a last-window
# use vi keybinding (basically just hjkl for navigation)
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
View app.js.coffee
# include ngGrid in our app:
@app = angular.module("breeze", ["... "ngGrid", ...])
# try to DI sortService from ngGrid
# (https://github.com/angular-ui/ng-grid/blob/8017eee035ac21ce9989eb26ea5dc6c13b9553cd/src/services/SortService.js)
ComplaintReportCtrl = ($scope, ComplaintReport, $sortService) ->
# then call it:
@dukedave
dukedave / has_many_inverse_of.rb
Created Dec 24, 2013
Code for Bi-directional associations in Rails 4.
View has_many_inverse_of.rb
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.0.0'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# This connection will do for database-independent bug reports.
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)
@dukedave
dukedave / error
Last active Dec 30, 2015
FloatDomainError: Infinity when updating PostgreSQL range with infinity (ActiveRecord 4.0.x) and PostgreSQL (9.2)
View error
1) Error:
RangeTest#test:
FloatDomainError: Infinity
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:97:in `to_r'
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:97:in `=='
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:97:in `=='
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:97:in `!='
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:97:in `_field_changed?'
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:66:in `write_attribute'
/home/dave/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.1/lib/active_record/attribute_methods/write.rb:21:in `__temp__e657d6f52716e67656='
You can’t perform that action at this time.