What you'll need
- nginx
- nginx-x-rid-header module (https://github.com/newobj/nginx-x-rid-header)
Why?
We want to track image downloads from client side and in javascript we cannot get the header values:(.
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; |
{ | |
"scripts": { | |
"eslint": "LIST=`git diff-index --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi" | |
}, | |
"devDependencies": { | |
"pre-commit": "0.0.7", | |
"eslint": "~0.5.1" | |
}, | |
"pre-commit": [ | |
"eslint" |
/* | |
URLs: | |
http://localhost:3000/arrive?foo=bar&utm_source=smart-redir | |
*/ | |
var redirect = require('redirect-with-params'); | |
var express = require('express'); | |
var app = express(); | |
app.use(redirect({ |
var Agent = {}; | |
Agent.check = function() { | |
var events = JSON.parse(this.memory('events') || '[]'); | |
this.log('memory is: (' + typeof events + '):' + JSON.stringify(events)); | |
var len = events.length; | |
var tags = (this.options('tags') || '').split(','); | |
var count = parseInt(this.options('count'), 10) || tags.length; | |
var delimeter = this.options('delimeter') || ','; | |
var tagPrefix = this.options('tagPrefix') || this.options('tagprefix') || ''; | |
if (len === 0) { |
{ | |
"scripts": { | |
"such-custom-script": "echo custom-script", | |
"presuch-custom-script": "echo pre-custom-script", | |
"postsuch-custom-script": "echo post-custom-script" | |
} | |
} |
We want to track image downloads from client side and in javascript we cannot get the header values:(.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> | |
<title>Menetrend Online</title> | |
<link id="screencss" href="style01.css" rel="stylesheet" type="text/css" media="screen"> | |
<link id="printcss" href="print.css" rel="stylesheet" type="text/css" media="print"> | |
<script type="text/javascript" src="scripts.php"></script> |
function onport(){ | |
lsof -n -i4TCP:$1 | grep LISTEN | |
} | |
function tmuxhelp() { | |
open "https://gist.github.com/henrik/1967800" | |
} |
{ | |
"scripts": "mocha -r should '*.spec.js'" | |
} |
export function simple(num) { | |
return { | |
type: 'add', | |
payload: { | |
num | |
} | |
}; | |
} | |
export function withDispatch(num) { |