Skip to content

Instantly share code, notes, and snippets.

View vagmi's full-sized avatar

Vagmi Mudumbai vagmi

View GitHub Profile

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

var enableMultipleViewFolders = function(express) {
var eView= express.get('view');
var lookupProxy = eView.prototype.lookup;
eView.prototype.lookup = function (view) {
if (this.root instanceof Array) {
var opts = {};
var matchedView = null,
roots = this.root;
@vagmi
vagmi / .vimrc
Created July 23, 2014 08:52
My latest lean vimrc config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@vagmi
vagmi / app.js
Created April 1, 2014 22:03 — forked from simme/app.js
// Load Ember into the global scope by requiring it
require('ember');
// Go have fun
var app = Ember.Application.create();
# Increase system IP port limits to allow for more connections
net.ipv4.ip_local_port_range = 2000 65000
net.ipv4.tcp_window_scaling = 1
# number of packets to keep in backlog before the kernel starts dropping them
net.ipv4.tcp_max_syn_backlog = 3240000
# increase socket listen backlog
net.core.somaxconn = 65536
net.ipv4.tcp_max_tw_buckets = 1440000
@vagmi
vagmi / decipher me
Created December 24, 2013 17:01
ReduceData is looking for awesome hackers
H4sICC21uVIAA3JlY3J1aXRtZW50LnR4dABVkDFuwzAMRXef4iOz4TMUSQsE
HdOhM2sztmJZNEjJSm9fxp66cOAnHx9446H0jHfKhGCIInNII+6ioMomC2Oi
fma1rmk+FgoRv1IUylY8y4KNxiW86c4ZHNP1ghryhDx5zs+M0/Ug4FYinxDS
Hln5eXCfEUPirvlmkPK/+yMnVorBsqFO4h4bg58ra+Dkzj5SpcTBCfNuUkXn
4/QlyqMot80nbdTieibjFl8r6dziQmaUBiV4hbiL+rZEcwMp3nrZncN4PMVW
6t3vDzKuTicoAQAA
// A mini java http server
// courtesy http://cs.au.dk/~amoeller/WWW/examples/FileServer.java
import java.net.*;
import java.io.*;
import java.util.*;
public class FileServer
{
public static void main(String[] args)
Feature: Pay Auto Loan
As a Chase User with Auto loan
In order to avoid the late charges
I decide to pay the loan amount due within the due date
Background:
Given today is 25-Oct-2013
And I have logged in as a Chase user
And I have a checking account with the following details
| account_number | 12345 |
@vagmi
vagmi / gist:7151984
Created October 25, 2013 09:23
create maven project (mphasis)
mvn archetype:generate -DgroupId=in.vagmim.calculator -DartifactId=calculator -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
var lib = require("./manifest.js");
lib.mkmanifest({
filename : "cache"
,path : "../coffee"
,version : "02"
,exclude : ['/.DS_Store', '/.htaccess', '/cache.manifest']
/*
,network : ['/connect.php','/read.php']
,fallback : ['/offline.html']