Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
ContrastingSounds / State Machine Spreadsheet to PDF Diagrams.ipynb
Last active April 3, 2024 11:50
Generate state machine diagrams automatically from a spreadsheet of states and transitions. Supports Google Sheets and Excel.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
- name: Set timezone variables
mipearson / application_controller.rb
Last active December 26, 2015 22:49
Tracking default route usage with Rollbar
class ApplicationController < ActionController::Base
# ...
before_filter :check_for_default_route
class DefaultRouteException < Exception
# Placeholder exception so that we can report request & person data back
# to rollbar
Darep / rollbar.js
Last active December 21, 2015 22:29
Use Rollbar ( with Browserify
// Download rollbar.js and rollbar.min.js from:
// Place them into vendor/ and this code into lib/rollbar.js, or something
(function(w, d) {
w._rollbarParams = {
"server.environment": "production",
"notifier.snippet_version": "2"
mertonium / deploy.rb
Last active October 10, 2015 08:47
Capistrano task to notify about deployment
# I am trying out and I want to add their deployment notification to my
# normal capistrano deployment process. Here is my first working attempt.
# Add this task to your deploy.rb
namespace :rollbar do
task :notify, :roles => [:web] do
set :revision, `git log -n 1 --pretty=format:"%H"`
set :local_user, `whoami`
set :rollbar_token, YOUR_ACCESS_TOKEN
rails_env = fetch(:rails_env, 'production')
otobrglez /
Last active August 29, 2015 14:14
Rollbar log observer for Scrapy / Python
import rollbar
import logging
# Needed if you use rollbar.report_exc_info
import sys
class RollbarLogObserver(object):
def __init__(self, rollbar_access_token, env="development", level=logging.INFO):
self.level = level
rollbar.init(rollbar_access_token, env)