with PM2 & Nginx
as a root, run below commands on server:
# adduser tomy
| function get(uri) { | |
| return http(uri,'GET'); | |
| } | |
| function post(uri,data) { | |
| if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) { | |
| var params = []; | |
| for(var p in data) { | |
| if(data[p] instanceof Array) { | |
| for(var i = 0; i < data[p].length; i++) { | |
| params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][i]); |
| var parser = function(url) { | |
| var a = document.createElement('a'); | |
| a.href = url; | |
| var search = function(search) { | |
| if(!search) return {}; | |
| var ret = {}; | |
| search = search.slice(1).split('&'); | |
| for(var i = 0, arr; i < search.length; i++) { |
| 用html,css实现以下三种情况的布局: | |
| 1. 2列布局:左固定,右自适应。 | |
| 2. 3列布局:左右固定,中自适应。 | |
| 3. 2行上下布局,下是左右布局: | |
| a. 头部高固定且位置固定, | |
| b. 下左宽度固定,下右宽度自适应且实现iframe高度自适应, | |
| c. 全屏无横向滚动条,下左,下右内容超出高度时出现纵向滚动条 (可以不考虑ie6,用纯css实现)。 | |
| PS: | |
| 1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 |
| // need two files | |
| // <script language="JAVASCRIPT" src="../js/infobox.js"></script> | |
| // <script language="JAVASCRIPT" src="../js/markerwithlabel.js"></script> | |
| var helper = {}; | |
| //map style array | |
| var style_pale = [{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#acbcc9"}]},{"featureType":"landscape","stylers":[{"color":"#f2e5d4"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#c5c6c6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#e4d7c6"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#fbfaf7"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#c5dac6"}]},{"featureType":"administrative","stylers":[{"visibility":"on"},{"lightness":33}]},{"featureType":"road"},{"featureType":"poi.park","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":20}]},{},{"featureType":"road","stylers":[{"lightness":20}]}]; | |
| //helper中map会需要的函数放在此处 | |
| helper.map = { |
| /* | |
| Bare bones template engine | |
| */ | |
| const hydrate = function(template, scope) { | |
| if ( | |
| template.constructor === String && | |
| template.length && | |
| scope.constructor === Object && | |
| Object.keys(scope).length | |
| ) { |
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express') | |
| , routes = require('./routes') | |
| , user = require('./routes/user') | |
| , http = require('http') | |
| , path = require('path') |
| var app = angular.module('app', ['angular-google-analytics']) | |
| .config(function(AnalyticsProvider) { | |
| // initial configuration | |
| AnalyticsProvider.setAccount('UA-XXXXX-xx'); | |
| // track all routes (or not) | |
| AnalyticsProvider.trackPages(true); | |
| })) | |
| .controller('SampleController', function(Analytics) { | |
| // create a new pageview event |