Skip to content

Instantly share code, notes, and snippets.

View rgwozdz's full-sized avatar

Rich Gwozdz rgwozdz

  • Esri
  • Bellingham, WA
View GitHub Profile
upstream apt-api {
server 127.0.0.1:9000;
}
server {
listen 0.0.0.0:80;
server_name apt-api.spatialdevmo.com;
access_log /var/log/nginx/apt-api.spatialdevmo.log;
# Gzip Compression
@rgwozdz
rgwozdz / gist:22232c592b509236cc52
Created May 27, 2015 21:06
Static site NGINX
upstream apt-web{
server 127.0.0.1;
}
# NGINX Server Instance
server {
listen 0.0.0.0:80;
server_name apt.spatialdevmo.com;
access_log /var/log/nginx/apt.spatialdevmo.log;

##Prerequisites In order to follow this guide, you should have a Fully Qualified Domain Name pointed at your Ubuntu 14.04 server.

For example:

sd-pmte-stage.spatialdevmo.com points to 54.83.188.204

##Install the Software The installation process of Postfix on Ubuntu 14.04 is easy because the software is in Ubuntu's default package repositories.

@rgwozdz
rgwozdz / nginx-subdomains.md
Created August 14, 2014 01:35
2 node apps on one Ubuntu EC2, access via two different subdomains

create this file:

/etc/nginx/sites-available/crp-pmte-stage.spatialdevmo.com

This file will handle visits to crp-pmte-stage.spatialdevmo.com. A Node.js app running on port 5000 needs to be served. Give the file this content:

upstream crp-pmte-stage {
    server 127.0.0.1:5000;
}
@rgwozdz
rgwozdz / terminal-direct.sh
Created March 1, 2014 04:03
Change which folder your Mac OSX terminal points to when opened.
echo "cd $directory" >> ~/.bash_profile
_SPDEV.TableWithDetails = (function (module) {
// View for the whole header
var HeaderCollectionView = Backbone.CollectionView.extend({
initialize: function (args) {
this.viewClass = (typeof args.viewClass === 'undefined') ? Backbone.View : args.viewClass;
// Create an array property that will store model views contained in this collection view
@rgwozdz
rgwozdz / ajax_post.js
Created December 16, 2013 04:13
Ajax POST
$.ajax({
context: this,
type: 'POST',
data: {},
dataType: "json",
url: '',
success: function(data, textStatus, jqXHR){},
error: function(jqXHR, textStatus, errorThrown){}
});
@rgwozdz
rgwozdz / gist:7780263
Created December 4, 2013 00:27
Update node package manager
sudo npm install npm@latest -g
@rgwozdz
rgwozdz / console-plugin.js
Created November 29, 2013 06:36
Avoid 'console' errors in browsers that lack a console.
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
#Before you can start working locally on a remote branch, you need to fetch it as called out in answers below.
#To fetch a branch, you simply need to:
git fetch origin
#This will fetch all of the remote branches for you. With the remote branches in hand, you now need to check out the branch you are interested in, giving you a local working copy:
git checkout -b test origin/test