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 ObjectID = require('mongodb').ObjectID; | |
var configHelper = /* redacted */; | |
var config = require('config'); | |
var mongodb = require('mongodb'); | |
var MongoClient = mongodb.MongoClient; | |
var lib = /* redacted */; | |
// Map of database connection keyed by collection's tenantId | |
var databaseConnectionMap = {}; |
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
#!/bin/sh | |
files=$(git diff --name-only --diff-filter=ACM | grep ".js$") | |
if [ "$files" = "" ]; then | |
exit 0 | |
fi | |
pass=true | |
echo "\nValidating JavaScript:\n" |
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 nginx.conf servers as the main config file for webflow reverse proxy | |
## | |
## RCS: | |
## https://gist.github.com/sansmischevia/5617402 | |
## | |
## Hardening tips: | |
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html | |
## |
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
# AMI: ami-3275ee5b | |
# Login: ec2-user | |
# Apply updates | |
sudo yum update | |
# Enable Epel Repo | |
sudo vim /etc/yum.repos.d/epel.repo. | |
# Under the section marked [epel], change enabled=0 to enabled=1. |
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
<key>HardResourceLimits</key> | |
<dict> | |
<key>NumberOfFiles</key> | |
<integer>1024</integer> | |
</dict> | |
<key>SoftResourceLimits</key> | |
<dict> | |
<key>NumberOfFiles</key> | |
<integer>1024</integer> | |
</dict> |
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 cluster = require('cluster'), | |
os = require('os'), | |
http = require('http'); | |
// List of 'active' workers: | |
var workers = []; | |
var start_count = 0; | |
// The amount of time we wait before killing a process during a reload: |
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
#!/bin/sh | |
dest="$HOME/git-commit-snapshots/" | |
mkdir -p $dest | |
path=$dest/`date +%s`.jpg | |
imagesnap -w 1 -q $path & |
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 Value(value) { | |
switch (typeof value) { | |
case "number": return {N: String(value)} | |
case "string": return {S: value} | |
} | |
if (value) switch (typeof value[0]) { | |
case "number": return {NS: value.map(String)} | |
case "string": return {SS: value} | |
} |
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 DATABASE = {}; | |
/** | |
* Start awk-sdk mock | |
*/ | |
exports.getItem = function(params, cb) { | |
if (params.AttributesToGet) { | |
var ret = { | |
Item: {} | |
}; |
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
" .vimrc | |
" http://github.com/niw/profiles | |
"{{{ Initialize | |
if !exists('s:loaded_vimrc') | |
" Don't reset twice on reloading, 'compatible' has many side effects. | |
set nocompatible | |
endif |