Bryant Chou sansmischevia

View nginx.conf
1 2 3 4 5 6 7 8 9
##
## 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
##
View Graphite on Amazon Linux
1 2 3 4 5 6 7 8 9 10
# 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.
View org-mongodb-mongod-plist
1 2 3 4 5 6 7 8 9 10
<key>HardResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>1024</integer>
</dict>
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>1024</integer>
</dict>
View cluster.js
1 2 3 4 5 6 7 8 9 10
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:
View post-commit
1 2 3 4 5 6 7 8 9
#!/bin/sh
 
dest="$HOME/git-commit-snapshots/"
 
mkdir -p $dest
 
path=$dest/`date +%s`.jpg
 
imagesnap -w 1 -q $path &
View value.js
1 2 3 4 5 6 7 8 9 10
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}
}
View mockDynamo.js
1 2 3 4 5 6 7 8 9 10
var DATABASE = {};
/**
* Start awk-sdk mock
*/
exports.getItem = function(params, cb) {
if (params.AttributesToGet) {
var ret = {
Item: {}
};
View .vimrc
1 2 3 4 5 6 7 8 9 10
" .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
View screening.js
1 2 3 4 5 6
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
Something went wrong with that request. Please try again.