Skip to content

Instantly share code, notes, and snippets.

View gabrieljoelc's full-sized avatar

Gabriel Chaney gabrieljoelc

View GitHub Profile
@gabrieljoelc
gabrieljoelc / gist:5977c953e27eb3acca203a5683f72e84
Created August 29, 2016 07:16
Fivefold Ministry Questionnaire questions
I am good at listening and taking in what people say.
People say I am good at presenting information and ideas.
When I’m excited about something, I get others interested in it too.
I can accurately assess a person based on first impressions and know instinctively if they are being real with me.
I can be counted on to contribute original ideas.
I see more value in building up something meaningful and useful than always striking out into new territory.
I try explaining things in different ways if people are finding a concept difficult to grasp or understand.
People with different value systems have said that they feel comfortable when they are around me, and that I have a positive effect on them being open to new ideas.
People comment that I am unusually creative.
People describe me as entrepreneurial.
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
require 'csv'
require 'gems'
CSV.open("#{ENV['HOME']}/Documents/gems_and_metadata.csv", 'wb') do |csv|
gems = CSV.foreach("#{ENV['HOME']}/Documents/gems.csv") do |row|
new_row = row.concat([nil, nil])
begin
info = Gems.info(row.first)
new_row[new_row.size - 2] = info['authors']
new_row[new_row.size - 1] = info['homepage_uri']
@gabrieljoelc
gabrieljoelc / gist:935e98727494fa860533
Last active August 29, 2015 14:22
Sidekiq configuration notes from happy hour session with Mike Perham
* 1X Dyno supports about 5 threads so use 2X Dyno
* DB pool
* Add database.yml for production now
* Unicorn 1
* Puma per web concurrency
* Sidekiq per concurrency
* Remove redis sizes
* PX dyno?
* More dynos
* 1-2 threads can share a database pool

On a company's balance sheet, accounts receivable are the money owed to that company by entities outside of the company. Account receivables are classified as current assets assuming that they are due within one calendar year or fiscal year. To record a journal entry for a sale on account, one must debit a receivable and credit a revenue account. When the customer pays off their accounts, one debits cash and credits the receivable in the journal entry. The ending balance on the trial balance sheet for accounts receivable is usually a debit.

@gabrieljoelc
gabrieljoelc / dollarable.rb
Created February 26, 2015 23:26
Little module for define dynamic methods that automatically convert values from methods ending in `_cents` methods to `BigDecimal` dollars.
module Dollarable
def acts_as_dollarable
attribute_names.select { |m| m.ends_with?('_cents') }.each do |m|
define_method m.gsub(/_cents/, '') do
value = send(m)
return BigDecimal(0) if value.blank? || value.zero?
BigDecimal(value) / 100
end
end
end
@gabrieljoelc
gabrieljoelc / env.rb
Last active August 29, 2015 14:10 — forked from opsb/gist:3486581
Spinach adapter for Sauce Connect
ENV['RAILS_ENV'] = 'test'
require './config/environment'
require 'minitest/spec'
require 'spinach/capybara'
require_relative 'spinach_helper'
require_relative 'sauce'
Spinach::Scenario.send(:prepend, SpinachHelper::Scenario)
begin
@gabrieljoelc
gabrieljoelc / gist:cb079557fc9bfc9870c5
Created December 4, 2014 00:16
### Keybase proof
### Keybase proof
I hereby claim:
* I am gabrieljoelc on github.
* I am gabrieljoelc (https://keybase.io/gabrieljoelc) on keybase.
* I have a public key whose fingerprint is 1DC6 3C05 B86E 1AF7 7987 DA18 C44E FDC4 9C79 5BF9
To claim this, I am signing this object:
queue = Sidekiq::Queue.new("deferred")
csv CSV.new
queue.each do |job|
job.klass # => 'DeferredReady'
job.args # => [1]
csv << "#{job.id}#{job.klass},#{job.args}"
end
queue.clear
@gabrieljoelc
gabrieljoelc / ruby_2_0_class_prepend.rb
Last active August 29, 2015 14:05
Ruby inheritance, inner classes, and class methods with `const_get`
module Ruby2Prepend
module GetExtensions
module ClassMethods
def get
super + 1
end
end
def self.prepended(base)
class << base