This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var require = { | |
baseUrl: '/js/app', | |
paths: { | |
requireLib: '../components/requirejs/require', | |
jquery: '../components/jquery/jquery', | |
react: '../components/react/react', | |
moment: '../components/moment/moment', | |
eventemitter2: '../components/eventemitter2/lib/eventemitter2', | |
twix: '../lib/twix', | |
numeral: '../components/numeral/numeral' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "some-project", | |
"version": "0.0.1", | |
"dependencies": { | |
"requirejs": "latest", | |
"moment": "latest", | |
"react": "latest", | |
"eventemitter2": "latest" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
define(['react', 'socket', 'eventemitter2', './Menu'], function (React, socket, EventEmitter2, Menu) { | |
var eventBus = new EventEmitter2({ | |
wildcard: true, | |
newListener: false, | |
maxListeners: 20 | |
}); | |
var menuItems = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env COPTFLAGS="-O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing" CC=clang CXX=clang++ CPP=clang-cpp CFLAGS="-O2 -pipe -fno-strict-aliasing" ./configure --enable-fpm --with-fpm-user=www --with-fpm-group=www --disable-cgi --with-config-file-path=/usr/local/etc --with-config-file-scan-dir=/usr/local/etc/php.d --with-openssl --with-zlib --enable-bcmath --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-t1lib --enable-gd-native-ttf --with-mhash --enable-intl --enable-mbstring --with-mcrypt --with-mysqli --enable-pcntl --with-pdo-mysql --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xsl --enable-zip --enable-mysqlnd --with-pear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var socket = io.connect('http://' + location.host), | |
$body = $('body'), | |
body_width = $body.width(), | |
body_height = $body.height(), | |
count_datapoints = 0, | |
$map = $('#map'), | |
datapoints = 1500, | |
heatmap = new google.maps.visualization.HeatmapLayer({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var server = require('http').createServer(app); | |
var io = require('socket.io').listen(server); | |
var amqp = require('amqp'); | |
var amqpc = amqp.createConnection({ host: 'somehost', login: 'guest', password: 'guest', vhost: '/' }); | |
process.on('exit', function() { | |
amqpc.close(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var redis = require("redis"), | |
client = redis.createClient(); | |
var amqp = require('amqp'); | |
var amqpc = amqp.createConnection({ host: 'somehost', login: 'guest', password: 'guest', vhost: '/' }); | |
var geoip = require('geoip-lite'); | |
var ll = require("lazylines"); | |
amqpc.on('ready', function () { | |
amqpc.exchange('heatmap', {passive: true}, function(e){ | |
process.stdin.resume(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isNoHomepageSearch(input) { | |
return input !~ /bIsWorldwide/ | |
} | |
function getIp(input) { | |
return $3 | |
} | |
function isGetRequest(input) { | |
return input ~ /^"GET/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |