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
| node有一个模块叫n(这名字可够短的。。。),是专门用来管理node.js的版本的。 | |
| 首先安装n模块: | |
| ``` | |
| npm install -g n | |
| ``` | |
| 第二步: | |
| 升级node.js到最新稳定版? | |
| ``` | |
| n stable |
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
| var src = 'ABC 🍇'; | |
| src = src.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g, ''); | |
| console.log(src); |
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
| var express = require('express'), | |
| exphbs = require('express3-handlebars'), | |
| app = express(), | |
| hbs; | |
| hbs = exphbs.create({ | |
| helpers: { | |
| block: function (name) { | |
| var blocks = this._blocks, |
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
| /*! | |
| * compress.js | |
| * @version 1.0 | |
| * @author 刘兴 | |
| * | |
| * 这是一个基于canvas,应用在移动端的前端图片压缩的JS,其修正了上传时图片倒转等问题。 | |
| * Date: 2014-07-02 | |
| */ | |
| (function (window) { |
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
| /** | |
| * Created by liuxing on 16/1/20. | |
| */ | |
| var UPYUN = require('upyun'); | |
| var upyun = new UPYUN('', '', ''); | |
| var initDir = '/u/1'; | |
| function getCount(){ |
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
| #设置安装路径 chmod +x install_nginx.sh | |
| save_path="/usr/local/" | |
| #各安装包的版本 | |
| pcre="8.38" | |
| path_pcre="pcre-${pcre}" | |
| zlib="zlib-1.2.8" | |
| openssl="openssl-1.0.1j" | |
| nginx="nginx-1.8.0" | |
| node="v0.12.2" |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="author" content="http://www.softwhy.com/" /> | |
| <title>Asyncing</title> | |
| <style> | |
| body{ | |
| margin:0; | |
| padding:0; |
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
| /** | |
| * Created by liuxing on 16/6/23. | |
| */ | |
| var request = require('request'); | |
| var crypto = require('crypto'); | |
| var UPYUN_CACHE = 'http://purge.upyun.com/purge/'; | |
| function md5sum(data) { | |
| var md5 = crypto.createHash('md5'); | |
| md5.update(data, 'utf8'); |
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 hidden characters
| { | |
| "presets": [ | |
| "es2015", | |
| "stage-0", | |
| "react" | |
| ], | |
| "plugins": [ | |
| "syntax-export-extensions", | |
| "transform-export-extensions", | |
| "add-module-exports" |
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
| var AliMNS = require("ali-mns"); | |
| var ENV = process.env; | |
| var account = new AliMNS.Account(ENV.MQS_ACCOUNTID, ENV.MQS_KEY, ENV.MQS_SECURITY); | |
| module.exports = { | |
| MQActivity: new AliMNS.MQ(sails.config.mqs.queues.activity, account, ENV.MQS_REGION), // message queue client | |
| MQElastic: new AliMNS.MQ(sails.config.mqs.queues.elastic, account, ENV.MQS_REGION) // message queue client | |
| }; | |