Skip to content

Instantly share code, notes, and snippets.

@reklis
reklis / .zprofile
Last active May 17, 2016 22:53
zsh profile baseline
for f (~/.zshrc.d/**/*.sh) {
source $f
}
source ~/.zsh-keybindings
source ~/.zsh-prompt
@reklis
reklis / web-log-processing-example.cake
Created September 6, 2013 16:32
FunnelCake definition for basic web log analysis using BrightContext
INPUT requests;
// example: { action: 'GET', path: '/', code: 200 }
OUTPUT requestmetrics;
// send out the number of requests in that window every 5 seconds
requestmetrics = GROUP requests
BY TIMEONLY
@reklis
reklis / index.html
Last active December 22, 2015 11:29
A basic dashboard to view the results from the Node.js input
<body>
<div class="label">Current Real-Time Server Requests</div>
<div id="request-count">0</div>
<div class="total">Total:
<span id="total-request-count">0</span>
</div>
<div class="footnote">Powered by
<a href="http://brightcontext.com">BrightContext</a>
</div>
</body>
@reklis
reklis / install-and-run.sh
Last active December 22, 2015 11:29
A simple node script to tail web logs into a BrightContext QuantChannel Input
# download and extract the gist, then from inside the folder
chmod +x ./tail-web-logs.js
# install dependencies
npm i
# tail the web logs into the input
./tail-web-logs.js --apikey="your api key" --project="www metrics" --channel="weblogs" --input="requests" --logfile=/var/log/httpd/access_log
@reklis
reklis / node-w3c-log-input.js
Created September 5, 2013 20:38
Example of tailing standard w3c log files into brightcontext as an input
#!/usr/bin/env node
/*global require, console */
(function () {
'use strict';
var
bcc = require('brightcontext'),
argv = require('optimist')
@reklis
reklis / mancolors.zsh
Created August 16, 2013 13:37
blue+white man colors
# save to ~/.oh-my-zsh/colors/mancolors.zsh and add 'mancolors' to your ~/.zshrc plugin load list
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;34m") \
LESS_TERMCAP_md=$(printf "\e[1;34m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
sudo su -
# install node
yum -y install git-all
# latest
cd /opt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bcc + webrtc</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
function gitprompt() {
local NONE="\033[0m" # unsets color to term's fg color
# regular colors
local K="\033[0;30m" # black
local R="\033[0;31m" # red
local G="\033[0;32m" # green
local Y="\033[0;33m" # yellow
local B="\033[0;34m" # blue
local M="\033[0;35m" # magenta
@reklis
reklis / CountdownView.h
Created February 11, 2013 15:45
Countdown View using FlipCounter
#import <UIKit/UIKit.h>
#import "FlipCounterView.h"
void SplitTimeIntervalIntoComponents(NSTimeInterval t, int* hours, int* minutes, int* seconds);
@protocol CountdownViewDelegate;
@interface CountdownView : UIView