Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
@ContrastingSounds
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.
@otobrglez
otobrglez / log.py
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)
@mipearson
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
end
@Darep
Darep / rollbar.js
Last active December 21, 2015 22:29
Use Rollbar (https://rollbar.com/) with Browserify
// Download rollbar.js and rollbar.min.js from:
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.js
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.min.js
//
// 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"
@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@mertonium
mertonium / deploy.rb
Last active October 10, 2015 08:47
Capistrano task to notify Ratchet.io about deployment
# I am trying out Ratchet.io 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')