Skip to content

Instantly share code, notes, and snippets.

View nodesocket's full-sized avatar

Justin Keller nodesocket

View GitHub Profile
@nodesocket
nodesocket / gist:1396354
Created November 26, 2011 21:52
Bounce With Re-Writes
//Assume this structure storing routes and corresponding host and port
var routes = [ '/app1': { host: '127.0.0.1', port: 3000 },
'/app2': { host: '127.0.0.1', port: 3010 },
'/app3': { host: '127.0.0.1', port: 3020 } ];
http_proxy(function (req, bounce) {
var route = routes[req.url];
if(typeof route === "object") {
//Want to rewrite the url, remove '/app1' or basically the key in the array structure
@nodesocket
nodesocket / gist:1414355
Created December 1, 2011 06:37
Video CSS3 Effect
.vignette {
opacity: 0.55;
filter: alpha(opacity = 55);
-o-transition: opacity 0.30s linear;
-moz-transition: opacity 0.30s linear;
-webkit-transition: opacity 0.30s linear;
transition: opacity 0.30s linear;
}
.vignette:hover {
@nodesocket
nodesocket / gist:1415442
Created December 1, 2011 09:52
GitHub API Wrapper
<?php
////
// Dependencies
////
require_once(dirname(dirname(__FILE__)) . "/classes/Curl.php");
/**
* GitHub
*
* @todo
@nodesocket
nodesocket / gist:1415453
Created December 1, 2011 09:53
Curl Class
<?php
/**
* Curl
*
* @todo
*
* @version 1.0.0
* @date last modified 11/07/2011
*/
class Curl {
@nodesocket
nodesocket / gist:1429527
Created December 4, 2011 07:36
http-proxy re-write
var gear;
var starts_with_slash;
//Get if the request starts with a slash
req.url.substring(0, 1) === '/' ? starts_with_slash = true : starts_with_slash = false;
//Request starts with slash
if(starts_with_slash) {
//The position of the second slash, since the first slash is at index 0
var end = req.url.indexOf('/', 1);
@nodesocket
nodesocket / gist:1479120
Created December 14, 2011 23:35
Logify Client
/**
* logify
*
* @todo
*
* @version 0.1.6
* @date last modified 11/19/2011
* @author NodeSocket <http://www.nodesocket.com> <hello@nodesocket.com>
* @copyright (c) 2011 NodeSocket. All Rights Reserved.
*/
@nodesocket
nodesocket / gist:1512463
Created December 23, 2011 00:21
MSMTP SETUP
//First get the msmtp package, via wget
#wget http://downloads.sourceforge.net/project/msmtp/msmtp/1.4.24/msmtp-1.4.24.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmsmtp%2F&ts=1313388097&use_mirror=superb-sea2
//Untar it
#tar -xjvf msmtp-1.4.24.tar.bz2
//Switch into the newly created msmtp-1.4.24 directory
#cd msmtp-1.4.24
//If you don't have a c compiler already, you'll need to install gcc
@nodesocket
nodesocket / gist:1536007
Created December 29, 2011 20:15
Mixpanel Gearman Worker
<?php
/**
* Insert MixPanel Event
*
* @todo
*
* @version 1.0.4
* @date last modified 11/13/2011
* @author NodeSocket <http://www.nodesocket.com> <hello@nodesocket.com>
* @copyright (c) 2011 NodeSocket. All Rights Reserved.
@nodesocket
nodesocket / gist:3903388
Created October 17, 2012 02:29
Rules Engine Documentation

Rules Engine

The NetDNA Rules Engine provides a powerful method of controlling how edge servers interact with your content and your websites visitors. One way to think of it is a powerful tool set that allows you to do everything a .htaccess allows you to do with Apache on the network of NetDNA edge servers.

One way to think of this is that you can use Rules Engine for the following categories of rules:

  • ACLS (Access control lists) for permission
  • Redirects
  • Header manipulation
@nodesocket
nodesocket / v1.0.0
Created October 17, 2012 02:29
Rules Engine Documentation
Rules Engine
============
The NetDNA Rules Engine provides a powerful method of controlling how edge servers interact with your content and your websites visitors. One way to think of it is a powerful tool set that allows you to do everything a *.htaccess* allows you to do with Apache on the network of NetDNA edge servers.
One way to think of this is that you can use Rules Engine for the following categories of rules:
- ACLS (Access control lists) for permission
- Redirects
- Header manipulation