Skip to content

Instantly share code, notes, and snippets.

@boblail
boblail / errbit.rb
Last active January 2, 2016 14:38
Configure Airbrake to inform Errbit of GIT_COMMIT
Airbrake.configure do |config|
# ...
config.user_attributes = %w{id email} # the default is just 'id'
config.async = true # requires the gem 'sucker_punch' and 'airbrake ~> 3.1.15'
end
# Inform Errbit of the version of the codebase checked out
GIT_COMMIT = ENV.fetch('COMMIT_HASH', `git log -n1 --format='%H'`.chomp).freeze
@boblail
boblail / after_restart.rb
Created January 14, 2014 21:21
Configuring an EngineYard Deploy Hook to notify Houston
if %w{solo app_master}.member? config.current_role
app = config.current_path[/(?<=\/data\/)([^\/]+)(?=\/)/]
env = ENV["RAILS_ENV"]
sha = File.read("#{config.current_path}/REVISION").chomp
require 'net/http'
require 'uri'
uri = URI("http://status.cphepdev.com/projects/#{app}/deploy/#{env}")
configuration = config.configuration
@boblail
boblail / lily.js
Created May 5, 2020 19:08
Amazon's Angular app for v1 of the CCP
(function() {
angular
.module("ccpModule", ["ngRoute", "ngAnimate", "ngResource"])
.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl: "index.html",
controller: "MainController"
})
.when("/dialPad", {
@boblail
boblail / lily.js
Last active May 5, 2020 20:32
Amazon's Angular app for v1 of the CCP
(function() {
angular
.module("ccpModule", ["ngRoute", "ngAnimate", "ngResource"])
.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl: "index.html",
controller: "MainController"
})
.when("/dialPad", {
@boblail
boblail / mysql-insert_all-test.rb
Created February 27, 2021 14:01
Active Record Test single file
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails", branch: "master"