Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
试试看

xia xiadd

👨‍💻
试试看
View GitHub Profile
View hots.md

👩‍👩‍👧hello

View tuwan.js
/**
* 请预先安装axios,signale,async
* 并发请自行修改
*/
const axios = require('axios')
const signale = require('signale')
const url = require('url')
const fs = require('fs')
const mapLimit = require('async/mapLimit')
View china.geojson
Loading
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 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js
View better-nodejs-require-paths.md

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

View juhe.im.md

在线地址(支持https):

http://novel.juhe.im

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

部署

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

@xiadd
xiadd / app.js
Last active Feb 13, 2017
小程序示例
View app.js
//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,
View 知乎.md

xiadd

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

export defaule {
@xiadd
xiadd / history.md
Created Apr 25, 2016
html history api
View history.md

pushState里的title并没有什么卵用

(function (doc, win) {

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