Skip to content

Instantly share code, notes, and snippets.

View codeactual's full-sized avatar

David Smith codeactual

  • Found Apparatus
  • Portland, OR
View GitHub Profile
module.exports = function(grunt) {
return {
middleware: {
files: {
src: ['middleware/**/*.js']
}
}
};
};
@codeactual
codeactual / mainevent_nginx_access_preview.html
Created April 15, 2012 05:31
mainevent's nginx access log parser module (Preview HTML)
<span class="label label-{__codeClass}">{code}</span> {host} {method} {path}
{?referer}
<i class="icon-arrow-left"></i><a title="Referer" href="{referer}">{__refererMin}</a>
{/referer}
@codeactual
codeactual / mainevent_nginx_access_event.html
Created April 15, 2012 05:30
mainevent's nginx access log parser module (Event HTML)
{>event_header/}
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
@codeactual
codeactual / mainevent_nginx_access.js
Created April 14, 2012 01:11
mainevent's nginx access log parser module (JS)
'use strict';
var extend = require(__dirname + '/../../prototype.js').extend;
exports.NginxAccessParser = extend({name: 'NginxAccess', humanName: 'nginx access'}, {
parse: function(log) {
// From fluentd-0.10.9/lib/fluent/parser.rb:
return this.namedCapture(log, '^(?<host>[^ ]*) [^ ]+ (?<user>[^ ]+) \\[(?<time>[^\\]]+)\\] "(?<method>\\S+) (?<path>[^ ]+) \\S+ (?<code>[^ ]+) (?<size>[^ ]+) ("(?<referer>[^\\"]+)")? ("(?<agent>[^\\"]+)")?$');
},
var cache = new clientsiiide('MyFeedWidget');
// Asynchronous with read-through.
cache.get({
ns: 'tags',
keys: ['key1', 'key2'],
expires: 3600,
onDone: function(results) {
// Process key/value pairs in "results".
},