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)
<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>
<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 / Gruntfile.js
Last active August 29, 2015 14:10
ES6ify causes a crash on Travis-CI PhantomJS 1.9.8
var es6ify = require('es6ify');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jasmine: {
specs: {
src: [es6ify.runtime],
options: {
specs: '*Spec.js'
@robmadole
robmadole / stacktrace
Created December 1, 2014 17:16
PhantomJS 1.9.8 stack trace
Operating system: Linux
0.0.0 Linux 2.6.32-042stab090.5 #1 SMP Sat Jun 21 00:15:09 MSK 2014 x86_64
CPU: amd64
family 21 model 1 stepping 2
1 CPU
Crash reason: SIGSEGV
Crash address: 0x21
Thread 0 (crashed)