Skip to content

Instantly share code, notes, and snippets.

View robmadole's full-sized avatar

Rob Madole robmadole

View GitHub Profile
@robmadole
robmadole / cachex.ex
Created February 12, 2020 19:04
Example of a cachex hook being integrated with Prometheus
defmodule Kits.Metrics.Cachex do
@moduledoc """
Metrics related to our use of Cachex
"""
use Cachex.Hook
use Prometheus.Metric
alias Kits.Metrics
21:31:40 web.1 | 2016-02-15 21:31:40 +0000: Rack app error: #<NoMethodError: undefined method `[]=' for nil:NilClass>
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `block in call'
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `tap'
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
21:31:40 web.1 | /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
21:31:40 web.1 | /home/vagrant/.rbenv/v
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.5.1)
actionpack (= 4.2.5.1)
actionview (= 4.2.5.1)
activejob (= 4.2.5.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.5.1)
<noscript>
<link href="https://fonticons-free-fonticons.netdna-ssl.com/kits/a97ca672/a97ca672.css" media="all" rel="stylesheet">
<div class="flash-message flash-message-noscript show">
<h3 class="flash-title margin-top-none margin-bottom-sm"><i class="ficon ficon-oi"></i> Oi. You need to enable JavaScript.</h3>
<p class="flash-copy">Managing your assets with Fort Awesome relies on JavaScript. <a class="flash-link" href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a> and then we'll get you going.</p>
</div>
</noscript>
<div class="flash flash-danger">
<div class="container">
<noscript>
<link href="https://fonticons-free-fonticons.netdna-ssl.com/kits/a97ca672/a97ca672.css" media="all" rel="stylesheet">
<div class="flash-message flash-message-noscript show">
<h3 class="flash-title margin-top-none margin-bottom-sm"><i class="ficon ficon-oi"></i> Oi. You need to enable JavaScript.</h3>
<p class="flash-copy">Managing your assets with Fort Awesome relies on JavaScript. <a class="flash-link" href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a> and then we'll get you going.</p>
</div>
</noscript>
//= require "domready"
(function () {
domready(function () {
var bns;
var supported = (function () {
var checks = [];
try {
if (!Object.keys || !Array.prototype.map) {
{
"minify": false,
"options": [
"setClasses"
],
"feature-detects": [
"test/cookies",
"test/history",
"test/requestanimationframe",
"test/css/animations",
@robmadole
robmadole / makewsd
Created April 12, 2012 16:40
Command line util for using websequencediagrams.com
#!/usr/bin/env python2.7
import argparse
import urllib
import json
from os.path import realpath
parser = argparse.ArgumentParser(
"Use websequencediagrams.com to create diagrams from the command line")
parser.add_argument('file', help='path to the input file')
@robmadole
robmadole / sanecss.less
Created November 9, 2010 15:34
Good starting point for any project using CSS in LessCSS format
/**
* SaneCSS.less
*
* Solution for starting out with a good but basic CSS file. There are no vertical grids or media queries,
* just a reset, some sane defaults, and a configurable baseline grid.
*/
// Configure the baseline grid
@unit: 18px;