Skip to content

Instantly share code, notes, and snippets.

View klaveren's full-sized avatar

HvKlaveren klaveren

View GitHub Profile
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@oliverswitzer
oliverswitzer / nonModuleDirList.js
Created February 24, 2014 19:01
An example of a script that will filter files with certain extensions in Node.js
// asynchDirList.js
var fs = require('fs'); //require node filesystem module
var path = require('path'); //require node path module (a couple of tools for reading path names)
var pathSupplied = process.argv[2];
var extFilter = process.argv[3];
function extension(element) {
var extName = path.extname(element);
@jeffrafter
jeffrafter / server.js
Created August 28, 2010 21:37
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {