Skip to content

Instantly share code, notes, and snippets.

@duminhtam
duminhtam / nginx.conf
Created February 15, 2017 18:14 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@duminhtam
duminhtam / nginx.conf
Created February 15, 2017 18:12 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@duminhtam
duminhtam / client.js
Created October 18, 2016 17:04 — forked from nicokaiser/client.js
node.js 0.6.x garbage collector fail
var WebSocket = require('ws')
// open 200 connections that close after 5 seconds
for (var i = 0; i < 200; i++) { openWs() }
function openWs() {
var ws = new WebSocket('ws://localhost:8080')
ws.on('open', function() {
ws.send('hello')
setTimeout(function() { ws.close(); }, 5000)
@duminhtam
duminhtam / The Technical Interview Cheat Sheet.md
Created January 19, 2016 18:51 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.