Skip to content

Instantly share code, notes, and snippets.

@outmost
outmost / boomerangsampling.js
Created April 9, 2013 12:11
Random sampling of page load time using Boomerang - http://lognormal.github.io/boomerang/doc
<script defer type="text/javascript">
//set random variable
var x = Math.floor((Math.random()*100)+1);
//check to see whether user has tracking cookie set
if (document.cookie.search(/(^|;)perfTrack=/) > -1) {
//if tracking cookie has been set, create alert with page load time
@outmost
outmost / Graphite on Amazon Linux
Created May 7, 2013 10:41
Step-by-step guide to installing NodeJS, StatsD and Graphite on the Amazon Linux AMI
# Apply updates
sudo yum update
# Enable Epel Repo
sudo vim /etc/yum.repos.d/epel.repo.
# Under the section marked [epel], change enabled=0 to enabled=1.
# Install packages
@outmost
outmost / node_beacon.js
Last active December 17, 2015 01:58
Node JS beacon to capture performance metrics from Boomerang.
// Assumptions
// Boomerang makes beacon call to port :8080
// StatsD is running on same server (localhost)
// The following NodeJS modules are installed:
// https://github.com/tobie/ua-parser
// https://github.com/bluesmoon/node-geoip
// Boomerang is configured to send custom parameters for "domain", "page_type", "user_status", "ip" and "user_agent".
// http://lognormal.github.io/boomerang/doc/howtos/howto-5.html
@outmost
outmost / example.php
Last active December 17, 2015 01:58
Example Boomerang custom variables with PHP to get request IP and User Agent, javascript to get domain.
/* http://lognormal.github.io/boomerang/doc/howtos/howto-5.html */
<script type="text/javascript">
BOOMR.init({
beacon_url: "http://yoursite.com/path/to/beacon"
});
var domain = location.hostname;
@outmost
outmost / storage-schemas.conf
Created June 4, 2013 11:37
Size for Whisper db files at specified retention
10s:7d;1m:21d;10m:180d;1hr:2yr = 1.4mb per stat
@outmost
outmost / gist:6388914
Created August 30, 2013 11:24
Read and Write large files using NodeJS
var fs = require('fs');
var readline = require('readline');
var stream = require('stream');
var inputfile = "pathtofile.txt";
var outputfile = "pathtooutputfile.json";
var instream = fs.createReadStream(inputfile);
var outstream = fs.createWriteStream(outputfile, {'flags': 'a'});
outstream.readable = true;
@outmost
outmost / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;

Keybase proof

I hereby claim:

  • I am tomsutton1984 on github.
  • I am tomsuttton (https://keybase.io/tomsuttton) on keybase.
  • I have a public key ASApxJ_GZSku4BTgCQHouwgvkbvIqAIl-JI47FKesjM9Xgo

To claim this, I am signing this object: