Skip to content

Instantly share code, notes, and snippets.

View gabrieljoelc's full-sized avatar

Gabriel Chaney gabrieljoelc

View GitHub Profile
@gabrieljoelc
gabrieljoelc / hits.rb
Last active November 10, 2017 00:21
Ruby script to collect "hits" (successes) for developers
class Hits
attr_reader :client
def initialize(github_client)
@client = github_client
end
# Assumptions:
# - Using orgs
# - Closed dates range is a guess on things completed
@gabrieljoelc
gabrieljoelc / 0_steps.md
Last active May 27, 2019 20:11
Heroku Docker Rails 5.1.3, Ruby 2.4.2 (I need to add a Heroku template to https://github.com/nickjj/orats)

Steps to deploy Dockerized Rails app to Heroku

Prerequisites

  1. Install Docker
  2. Install Ruby
  3. gem install orats (see https://github.com/nickjj/orats)
  4. Install Heroku Toolbelt

Steps

@gabrieljoelc
gabrieljoelc / input.rb
Last active September 14, 2017 18:46
Standup service that is extendible on input and output (i.e. GitHub, Jira, and Trello for input with Slack and Email for output)
class InputProvider
def pull; end
end
class ManualInputProvider
def pull; end
end
class Array
def first
self[0]
end
def last
self[self.size - 1]
end
def distinct
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gabriel Chaney</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style>
  • It works
  • My team can understand it
  • I understand it
  • Breaking it has consequences (new changes velocity is slowed when the tests fail)

Add one

Would I like to do the work I'm expecting of the machine with this code? (Golden Rule)

  1. Would you want to act as the machine?

Generic Host w/ Docker

@gabrieljoelc
gabrieljoelc / heroku_invoice_csv.js
Last active August 11, 2017 21:34
Dumps a Heroku invoice into a CSV
// app,type(dyno,addon),name,dyno_type(if applicable),period,rate,total
// console.log(appTitle + ',addon,' + tr.find('.period').text() + ',' + tr.find('.rate').text() + ',' + tr.find('.total').text())
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/gm, '');
}
var RowBuilder = function(tr) {
this.nameElem = function() {
if (tr.find('.process').length > 0) {
return tr.find('.process');
@gabrieljoelc
gabrieljoelc / all_railsconf_years_cities.md
Last active December 10, 2016 19:05
List of all RailsConf years and the cities they were held in
  • 2006 - Chicago
  • 2007 - Portland
  • 2008 - Portland
  • 2009 - Las Vegas
  • 2010 - Balitmore
  • 2011 - Balitmore
  • 2012 - Austin
  • 2013 - Kansas City, MO
  • 2014 - Chicago
  • 2015 - Atlanta