I hereby claim:
- I am ajvargo on github.
- I am vargo (https://keybase.io/vargo) on keybase.
- I have a public key whose fingerprint is 203A 9F1A 8BA1 CAE1 CF11 1E02 ABFB B502 A5F5 B641
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# Prevents force-pushing to certain branches w.o confirmation | |
# install to <repo>/.git/hooks/ | |
# chmod +x | |
protected_branches="^(master|production)" | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
push_command=`ps -ocommand= -p $PPID` | |
force_push="force|delete|-f" |
#!/usr/bin/env ruby | |
require 'date' | |
class Repayment | |
MONTHLY_INTEREST = (<INTEREST (5.00)> / 12 / 100) | |
def initialize(payment, principal) | |
@payment, @principal = payment, principal | |
end |
require 'rspec/core/formatters/base_text_formatter' | |
# RSpec 2 | |
# rspec --require <path_to>/line_formatter.rb --format LineFormatter spec/ | |
# ./spec/lib/a_spec.rb:39 | |
# Success Thing#with_thing does thing | |
# | |
# ./spec/lib/a_spec.rb:45 | |
# pending Thing#does_other_thing is pending |
;; elisp | |
(setq jira-base-url "<JIRA BASE URL>" | |
jira-request-url (concat "https://" jira-base-url "/rest/api/latest/issue/") | |
jira-username "<USERNAME>" | |
jira-password "<PASSWORD>" | |
jira-credentials (base64-encode-string (concat jira-username ":" jira-password)) | |
;; this is a regex to trim things off the branch name | |
;; as is, removes: dev-, rel-, av-, dev/, rel/, av/ | |
jira-branch-trim-regex "^\\(dev\\|rel\\|\\av\\)\\(-\\|/\\)" | |
jira-auth-key (concat jira-base-url ":443")) |
#!/usr/bin/env ruby | |
# This prints a table showing how much a monthly payment | |
# would need to be to pay off a loan. It takes a max and | |
# min loan amount, and how much to jump between them. I | |
# use it to dream about paying off student loans. It allows | |
# me to see what my 1 year pay-off payments are as the loan | |
# gets paid back. | |
class PaymentCalculator |
# Based on http://stackoverflow.com/questions/2299139/retrieve-all-associations-attributes-of-an-ar-model | |
# Doesn't spelunk, doesn't name associations for easy consumption back. Good first go though. | |
# It gives the object attributes with the attributes of first cousin associations. | |
class ActiveRecord::Base | |
def attributes_with_associations | |
association_names = self.class.reflect_on_all_associations.collect { |r| r.name } | |
me = self.class.find self.id, :include => association_names | |
pairs = association_names.collect do |association_name| |
[user] | |
name = Andrew J Vargo | |
email = xxx@xxxxx.com | |
[alias] | |
co = checkout | |
w = whatchanged | |
br = branch | |
lo = log --oneline --decorate | |
ss = status -sb | |
last = log -n 1 |
(defun input-example (text) | |
"Gets user input and prints it back. Defaults to word at point" | |
(interactive | |
(list | |
(read-string | |
(format "Text (%s): " (word-at-point)) ; prompt. It's nice to show the default value | |
nil ; initial input. This value is prefilled in the mini-buffer. Available but considered deprecated. | |
nil ; history list if you have a specific one for this | |
(word-at-point) ; Whatever this evaluates to will be the default value | |
))) |
Dir.chdir '/Users/avargo/Music' do | |
File.open('../Downloads/all_random.m3u', 'w+') do |file| | |
Dir.glob('**/*.{mp3,ogg,wav}').shuffle.each do |song| | |
next if File.directory?(file) | |
file.write File.join(Dir.pwd, song, "\n") | |
end | |
end | |
end |