$ docker
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #! /bin/bash | |
| # ECHO COMMAND | |
| # echo Hello World! | |
| # VARIABLES | |
| # Uppercase by convention | |
| # Letters, numbers, underscores | |
| NAME="Bob" | |
| # echo "My name is $NAME" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # For more information on configuration, see: | |
| # * Official English Documentation: http://nginx.org/en/docs/ | |
| # * Official Russian Documentation: http://nginx.org/ru/docs/ | |
| user nginx; | |
| worker_processes 1; | |
| error_log /var/log/nginx/error.log; | |
| #error_log /var/log/nginx/error.log notice; | |
| #error_log /var/log/nginx/error.log info; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | 
Updated: October 2017
##Setup your server (this would ideally be done with automated provisioning)
- add a deploy user with password-less ssh see this gist
 - install forever 
npm install -g forever 
##Install flightplan
npm install -g flightplan- in your project folder 
npm install flightplan --save-dev - create a flightplan.js file
 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class Observable { | |
| constructor(subscriber) { | |
| this.subscriber = subscriber | |
| } | |
| subscribe(observer) { | |
| if (typeof observer == 'function') observer = {next: observer} | |
| if (!observer.next) observer.next = () => {} | |
| if (!observer.complete) observer.complete = () => {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function Observable(init_value) { | |
| var _value = init_value; | |
| var subscriber = []; | |
| function obs() { | |
| if (arguments.length) { | |
| _value = arguments[0]; | |
| obs.trigger(); | |
| return this; | |
| } else { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | CREATE VIEW ClassesAndRunningInformation AS | |
| SELECT | |
| ClassGroup.Name AS ClassGroupName, | |
| Running.StartDate, | |
| Module.Name AS ModuleName, | |
| Module.Length AS ModuleLength | |
| FROM | |
| ClassGroup | |
| INNER JOIN | |
| Running |