Skip to content

Instantly share code, notes, and snippets.

@gregersrygg
gregersrygg / notify-install.sh
Last active August 29, 2015 14:00
Removed shebang to make it less than 140 bytes
echo -e 'S=${*:-`cat`}\n/usr/bin/osascript -e "display notification \"$S\""'|sudo -s "cd /usr/local/bin;tee notify&&chmod +x notify"

Anivia

Anivia is Walmart's mobile analytics platform. It collects user-interaction metrics from mobile devices -- iPhone, iPad, Android, and mWeb. It also processes logging and other metrics from a bunch of mobile services. Anivia allows the business to have real-time insight and reporting into what is going on in the mobile business and provides vital capabilities for developers and ops folks to monitor the health of their services.

Anivia is built on Node.js, Hapi, RabbitMQ, and a multitude of downstream systems including Splunk and Omniture. Anivia is taking in 7,000 events per second on average (as of this writing), which after some fan-out and demuxing comes out to around 20,000 messages per second in flight. These rates are expected to soar leading up to and including Black Friday. The platform has grown in recent months to over 1,000 node processes spanning multiple data centers, gaining features such as link resiliency in the process.

A few of Anivia's functionalities

  • __Timestamp Correc
/**
* Based on node-uuid.js http://gist.github.com/393456
*
* Generates a new UUID and passes it to the given callback function.
*
* Calls uuid.sh - make your own depending on your system. I followed an example here: http://www.redleopard.com/2010/03/bash-uuid-generator/
*
* Callback signature is function(err, uuid).
*/
exports.create_uuid = (function() {
From 9241b751f9b42d970844fdc62fe84a01aa6d5203 Mon Sep 17 00:00:00 2001
From: Ryan Dahl <ry@tinyclouds.org>
Date: Wed, 6 Oct 2010 14:57:46 -0700
Subject: [PATCH] Raw string access
---
include/v8.h | 26 +++++++++
src/api.cc | 12 ++++
src/objects.cc | 65 ++++++++++++++++++++++
src/objects.h | 5 ++
@gbakernet
gbakernet / Node Smart Machine CouchDB
Created January 18, 2011 00:09
Node Smart Machine CouchDB
#Steps
pkgin install couchdb
svccfg import /opt/local/share/smf/manifest/couchdb.xml
svcadm enable couchdb
#Test
curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"1.0.1"}
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@addyosmani
addyosmani / async.js
Created February 7, 2012 17:20
Cache a library using localStorage and Base64
// some modified async work based on prior by necolas
(function(d){
var js,
fjs = d.getElementsByTagName('script')[0],
frag = d.createDocumentFragment(),
add = function(url, id) {
if (d.getElementById(id)) {return;}
js = d.createElement('script');
js.src = url;
id && (js.id = id);
function collectData(){
function copy(src, obj, keys){
for(var name, i = 0, len = keys.length; i < len; i++){
name = keys[i];
if(typeof src[name] !== 'undefined'){
if (typeof src[name] === 'function') { // function this and that
} else if (typeof src[name] === 'object'){
for(var subkey in src[name]){ obj[name+'_'+subkey] = src[name][subkey]; }
} else {
obj[name] = src[name];
@rraptorr
rraptorr / stunnel-4.56-xforwarded-for.diff
Created May 17, 2013 14:51
X-Forwarded-For stunnel 4.56 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 7624a27..3593f24 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -753,6 +753,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@creationix
creationix / app.js
Last active December 30, 2015 07:29
Generate a tree of events using process.addAsyncListener
var http = require('http');
var send = require('send');
var urlParse = require('url').parse;
var count = 2;
var server = http.createServer(function (req, res) {
if (!--count) server.close(); // Only allow two connection and then exit.
send(req, urlParse(req.url).pathname)
.root(__dirname)
.pipe(res);