This file contains 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
sudo apt-get update | |
# get ec2 ip and hostname | |
curl http://169.254.169.254/latest/meta-data/public-ipv4 > public.ip | |
curl http://169.254.169.254/latest/meta-data/public-hostname > public.hostname | |
echo 'colorscheme blue' > .vimrc | |
sudo apt-get install --yes build-essential curl git | |
#install latest node | |
sudo apt-get install --yes build-essential python-software-properties python g++ make |
This file contains 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
/** | |
* 根据容器宽高和当前图片宽高确定适应宽高 | |
* @param conW 容器宽度 | |
* @param conH 容器高度 | |
* @param imgW 图片宽度 | |
* @param imgH 图片高度 | |
* @returns {{w: *, h: *}} | |
*/ | |
getImgResize: function( conW, conH, imgW, imgH ){ | |
if( imgW <= conW && imgH <= conH ){ |
This file contains 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
/** | |
* 商品种类 | |
*/ | |
var Location = new schema({ | |
// 地点位置 | |
name: { type: String, required: true }, | |
// 位置GPS坐标 | |
location: { type: Array, index: "2d" } | |
}); |
This file contains 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
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var assert = require('assert') | |
console.log('\n==========='); | |
console.log(' mongoose version: %s', mongoose.version); | |
console.log('========\n\n'); | |
var dbname = 'testing_so-16747852'; |
This file contains 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
/** | |
* 商品种类 | |
*/ | |
var Location = new schema({ | |
// 地点位置 | |
name: { type: String, required: true }, | |
// 位置GPS坐标 | |
location: { type: Array, index: "2d" } | |
}); |
This file contains 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
sudo apt-get update | |
# get ec2 ip and hostname | |
curl http://169.254.169.254/latest/meta-data/public-ipv4 > public.ip | |
curl http://169.254.169.254/latest/meta-data/public-hostname > public.hostname | |
sudo apt-get install --yes build-essential curl git | |
#install latest node | |
sudo apt-get install --yes python-software-properties python g++ make | |
sudo add-apt-repository --yes ppa:chris-lea/node.js | |
sudo apt-get update |