Skip to content

Instantly share code, notes, and snippets.

View brennancheung's full-sized avatar

Brennan Cheung brennancheung

View GitHub Profile
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'int3/vim-extradite'
Plugin 'scrooloose/syntastic'
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'int3/vim-extradite'
Plugin 'scrooloose/syntastic'
@brennancheung
brennancheung / gist:1234134
Created September 22, 2011 05:38
nginx unicorn virtual host
server {
listen 80;
server_name foo.mydomain.com;
access_log /srv/sites/foo/access.log main;
error_log /srv/sites/foo/error.log info;
location / {
proxy_pass http://unix:/srv/sites/foo/unicorn.sock;
}
diff --git a/cookbooks/mongodb_sharding/recipes/configure.rb b/cookbooks/mongodb_sharding/recipes/configure.rb
index 8f07f05..9c10ee2 100644
--- a/cookbooks/mongodb_sharding/recipes/configure.rb
+++ b/cookbooks/mongodb_sharding/recipes/configure.rb
@@ -30,7 +30,8 @@ roles.each do |role, params|
Chef::Log.debug("running role #{role} with params #{params.inspect}")
role = role.to_s
mongo_data = @node[:mongo_base] + "/data_#{role}"
- mongo_log = @node[:mongo_base] + "/log_#{role}"
+ #mongo_log = @node[:mongo_base] + "/log_#{role}"
4_19 -> 3_10
4_15 -> 3_11
4_13 -> 4_10
4_17 -> 4_12
? -> 2_11 (still waiting to get a working non-domU node for this one but stuck as the moment because we can't add nodes)
@brennancheung
brennancheung / gist:f9fc20fa62c766d50b0b
Created November 24, 2015 06:59
simple-calc sample output
brennan@brennans-Mac-Pro ~/code/rpn * simple-calc $ cat testInput.txt | coffee rpn.coffee
> 5
5
> 8
8
> +
13
> -3
-3
> -2
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'int3/vim-extradite'
Plugin 'scrooloose/syntastic'
@brennancheung
brennancheung / gist:b525346212f2d582ec9d
Created January 5, 2016 05:35
nifty .bash_profile settings
alias ll="ls -lGh"
alias ls="ls -Gh"
alias p="ping google.com"
alias ss="python -m SimpleHTTPServer 3000"
alias gst="git status"
alias gc="git checkout"
alias gd="git diff"
import React from 'react'
import ReactDOM from 'react-dom'
import Rx from 'rxjs'
import { AppContainer } from 'react-hot-loader'
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import rootReducer from './reducers'
import App from './components/App'
@brennancheung
brennancheung / lookup-service-ips.js
Created March 1, 2017 20:57
look up the IPs of the containers for a Docker service
const dns = require('dns')
function lookup (serviceName) {
const tasks = `tasks.${serviceName}`
return new Promise((resolve, reject) => {
dns.lookup(tasks, { all: true }, (err, addresses, family) => {
if (err) {
return reject(err)
}
const filtered = addresses.filter(address => address.family === 4)