Skip to content

Instantly share code, notes, and snippets.

View xiadd's full-sized avatar
👨‍💻
试试看

xia xiadd

👨‍💻
试试看
View GitHub Profile
/**
* 请预先安装axios,signale,async
* 并发请自行修改
*/
const axios = require('axios')
const signale = require('signale')
const url = require('url')
const fs = require('fs')
const mapLimit = require('async/mapLimit')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiadd
xiadd / better-nodejs-require-paths.md
Created May 20, 2017 13:18 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

在线地址(支持https):

http://novel.juhe.im

注意: 如果运行在自己的服务器的话 请务必使用node 7.6 以上(因为很多模块直接用到了async,所以就算加上babel也没用, 打包过后仍然是直接引用)

部署

npm start: 启动开发服务器 通过babel转义

@xiadd
xiadd / app.js
Last active February 13, 2017 02:07
小程序示例
//app.js
App({
onLaunch: function () {
//获取当前位置,配合地图sdk使用
wx.getLocation({
type: 'wgs84', // 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标
success: function(res){
wx.request({
url: 'https://dev.xiadd.me/api/user/location',
data: res,
@xiadd
xiadd / 知乎.md
Last active August 25, 2016 09:04

xiadd

{
  'name': '21',
  'age': 12321213
}

export defaule {
/usr/local/etc/nginx/
@xiadd
xiadd / history.md
Created April 25, 2016 07:41
html history api

pushState里的title并没有什么卵用

(function (doc, win) {

  function Router () {
    this.state = {};
    this.events = [];
  }
  //添加popstate事件
 win.addEventListener('popstate', function (e) {

👩‍👩‍👧hello