Simple example of how easy it is to jam numbers into InfluxDB and graph something with Grafana. I choose to use Travis as a source of historical time-series data.
Get InfluxDB installed with Homebrew
$ brew install influxdb
daemon off; | |
worker_processes 4; | |
events { | |
use epoll; | |
accept_mutex on; | |
multi_accept on; | |
worker_connections 1024; | |
} |
require 'rubygems' | |
require 'eventmachine' | |
class SmtpSink < EM::Protocols::SmtpServer | |
def receive_data_chunk( data ) | |
buffer.concat data | |
end | |
def receive_message | |
puts |
/* | |
smtpd.js is SMTP server written for node.js | |
MIT License | |
*/ | |
var tcp = require('tcp'); | |
var sys = require('sys'); |
require 'rubygems' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
puts "Memory Usage Delta " | |
puts "============ ========" | |
loop do | |
agent.get('http://172.16.133.100:3000/session/new') |
Based heavily on [s3-beam][1], but uses re-frame events/subs to get the job done. The /sign
handler is the [s3-beam][1] handler (near verbatim).
For background on (ui.core/component "...")
see https://opensourcery.co.za/2017/02/12/using-semantic-ui-react-with-re-frame/
ui.ajax
is just thin wrappers and/or aliases around plumbing from ajax.core
from cljs-http
#!/bin/sh | |
# OSX friendly version by jeff donovan | |
# | |
# Grep for a pattern through a Postfix mail log, collect the message ids into a temporary | |
# file and then grep for all occurrences of the ID's in the maillog. | |
# This is a very intensive operation since it requires 1+N greps through the entire log file, | |
# where N is the number of unique ID's returned from the first grep. | |
# | |
# Usage sample: |
#!/usr/bin/env ruby | |
# | |
# Shotgun approach (read: slow and dirty hack) to help find unused helpers in a Rails application | |
# | |
puts "Loading all source files into memory :(" | |
source = {} | |
Dir["app/**/**/*.*"].each do |f| | |
source[ f ] = File.readlines( f ) |
class AnnouncementsController < ApplicationController | |
def index | |
pagination_options = { :page => params[:page], :per_page => params[:per_page] } | |
@announcements = Announcement.by_admins( params[:archived], pagination_options ) | |
end | |
end |