Skip to content

Instantly share code, notes, and snippets.

View rgwozdz's full-sized avatar

Rich Gwozdz rgwozdz

  • Esri
  • Bellingham, WA
View GitHub Profile
@rgwozdz
rgwozdz / apache-install
Last active December 20, 2015 11:59
Instructions for installing apache.
##################
# Apache Install #
##################
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
@rgwozdz
rgwozdz / apache-basic-authentication
Last active December 23, 2015 06:59
Apache basic authentication setup.
1) Open the http.conf file for editing:
# sudo pico /etc/apache2/http.conf.
2) Add specifics for each var/www directory to be placed under Basic Authentication:
<Directory "/var/www/my-web-app-directory">
AuthUserFile /etc/apache2/htpasswords
AuthName "Some silly message."
AuthType Basic
@rgwozdz
rgwozdz / CollectionViewTemplate
Last active December 26, 2015 19:09
Backbone.js Collection View Template
Backbone = (function (module) {
module.CollectionView = Backbone.View.extend({
initialize: function (args) {
var self, viewClass;
var self = this;
#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
@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'
];
@rgwozdz
rgwozdz / gist:7780263
Created December 4, 2013 00:27
Update node package manager
sudo npm install npm@latest -g
@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){}
});
_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 / 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
@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;
}