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
/** | |
* Created by liuxing on 16/1/20. | |
*/ | |
var UPYUN = require('upyun'); | |
var upyun = new UPYUN('', '', ''); | |
var initDir = '/u/1'; | |
function getCount(){ |
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
/*! | |
* compress.js | |
* @version 1.0 | |
* @author 刘兴 | |
* | |
* 这是一个基于canvas,应用在移动端的前端图片压缩的JS,其修正了上传时图片倒转等问题。 | |
* Date: 2014-07-02 | |
*/ | |
(function (window) { |
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 express = require('express'), | |
exphbs = require('express3-handlebars'), | |
app = express(), | |
hbs; | |
hbs = exphbs.create({ | |
helpers: { | |
block: function (name) { | |
var blocks = this._blocks, |
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 src = 'ABC 🍇'; | |
src = src.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g, ''); | |
console.log(src); |
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
node有一个模块叫n(这名字可够短的。。。),是专门用来管理node.js的版本的。 | |
首先安装n模块: | |
``` | |
npm install -g n | |
``` | |
第二步: | |
升级node.js到最新稳定版? | |
``` | |
n stable |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/** | |
* Copyright (c) 2014 Meizu bigertech, All rights reserved. | |
* http://www.bigertech.com/ | |
* @author liuxing | |
* @date 15/3/19 | |
* @description | |
* | |
*/ | |
var unidecode = require('unidecode'); |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
import DS from 'ember-data'; | |
var Article = DS.Model.extend({ | |
title: DS.attr(), | |
body: DS.attr(), | |
comments: DS.hasMany('comment',{async:true}) | |
}); | |
Article.reopenClass({ | |
FIXTURES: [ |