Skip to content

Instantly share code, notes, and snippets.

View zj8487's full-sized avatar

zj8487 zj8487

  • chengdu china
View GitHub Profile
@zj8487
zj8487 / doit.sh
Last active August 29, 2015 14:16 — forked from dirkk0/doit.sh
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
/**
* 商品种类
*/
var Location = new schema({
// 地点位置
name: { type: String, required: true },
// 位置GPS坐标
location: { type: Array, index: "2d" }
});
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';
/**
* 商品种类
*/
var Location = new schema({
// 地点位置
name: { type: String, required: true },
// 位置GPS坐标
location: { type: Array, index: "2d" }
});
/**
* 根据容器宽高和当前图片宽高确定适应宽高
* @param conW 容器宽度
* @param conH 容器高度
* @param imgW 图片宽度
* @param imgH 图片高度
* @returns {{w: *, h: *}}
*/
getImgResize: function( conW, conH, imgW, imgH ){
if( imgW <= conW && imgH <= conH ){
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