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
////////// Requires ////////// | |
var Fiber = require("fibers"); | |
var fs = require("fs"); | |
var http = require("http"); | |
var path = require("path"); | |
var url = require("url"); | |
// connect (and some other NPM modules) use $NODE_ENV to make some decisions; |
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
/** | |
* HTTP Header Security | |
* | |
* enforce HTTP Strict Transport Security (HSTS) to prevent ManInTheMiddle-attacks | |
* on supported browsers (all, but IE) | |
* > http://www.html5rocks.com/en/tutorials/security/transport-layer-security | |
* | |
* @header Strict-Transport-Security: max-age=2592000; includeSubDomains | |
*/ |
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
// 200k entries and more | |
HugeCollection = new Meteor.Collection("HugeCollection"); | |
// convenience collection to hold the computed stats of HugeCollection | |
StatsForHugeCollection = new Meteor.Collection("StatsForHugeCollection"); | |
/** | |
* Observer | |
*/ |
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
/***************************************************************************** | |
* QuantCup 1: Price-Time Matching Engine | |
* | |
* Submitted by: voyager | |
* | |
* Design Overview: | |
* In this implementation, the limit order book is represented using | |
* a flat linear array (pricePoints), indexed by the numeric price value. | |
* Each entry in this array corresponds to a specific price point and holds | |
* an instance of struct pricePoint. This data structure maintains a list |
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
/***************************************************************************** | |
* QuantCup 1: Price-Time Matching Engine | |
* | |
* Submitted by: voyager | |
* | |
* Design Overview: | |
* In this implementation, the limit order book is represented using | |
* a flat linear array (pricePoints), indexed by the numeric price value. | |
* Each entry in this array corresponds to a specific price point and holds | |
* an instance of struct pricePoint. This data structure maintains a list |
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
<VirtualHost 10.248.206.19:80> | |
ServerName some.domain.com | |
ProxyRequests Off | |
ProxyPreserveHost On | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> |
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
server { | |
server_name thomassteinhauer.com; | |
location / { | |
root /var/www/app/bundle/; | |
} | |
location /admin { | |
root /var/www/admin/bundle/; | |
} |
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
#!/usr/bin/env bash | |
#get own hostname | |
ME=$(hostname); | |
# find replica-set master, we think its the first in the array | |
MASTER=`mongo --quiet --eval "cfg=rs.config(); print( cfg.members[0].host );"` | |
# connect to master, add ME | |
mongo --host $MASTER --eval "print( rs.add('"$ME"') );" |
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
<? | |
/** | |
* Debug helper function. This is a wrapper for var_dump() that adds | |
* the <pre /> tags, cleans up newlines and indents, and runs | |
* htmlentities() before output. | |
* | |
* @param mixed $var The variable to dump. | |
* @param string $label OPTIONAL Label to prepend to output. | |
* @param bool $echo OPTIONAL Echo output if true. | |
* @return string |
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
// ///////////////////////////////////////////////// | |
// this file contains all the classes related to a | |
// market. | |
// ///////////////////////////////////////////////// | |
var log4js = require('log4js'); | |
var logger = log4js.getLogger(require('path').basename(__filename, '.js')); | |
require('es6-collections'); | |
var _ = require('underscore'); | |
/** |
OlderNewer