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
/* | |
introduction: 中国最新省市区数据 | |
发布时间:2017-03-10 10:33 | |
usage: | |
- open http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201703/t20170310_1471429.html | |
- copy below lines code to console (F12) | |
data: https://gist.githubusercontent.com/suhaotian/cd31a6ca16e5298a1aae3dc7871d0660/raw/368916778e2cd8c0fa15f378879fa89dadaa96e8/china-address.json | |
*/ | |
let provinces = [] |
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
[ | |
{ | |
"code": "110000", | |
"name": "北京市", | |
"city": [ | |
{ | |
"code": "110100", | |
"name": "市辖区", | |
"area": [ | |
{ |
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
const React = require('react'); | |
const ReactDOMServer = require('react-dom/server'); | |
require('babel-register')({ | |
extensions: ['.jsx'] | |
}); | |
hexo.extend.renderer.register('jsx', 'html', function(data, options) { | |
require.cache[data.path] && delete require.cache[data.path] |
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
// in package.josn, add below lines to scripts: | |
// "postbuild": "node ./delete-sourcemap.js" | |
const fs = require('fs') | |
function deleteMaps(dir) { | |
fs.readdir(dir, function(err, files) { | |
files.forEach((file) => { | |
if(/\.map$/.test(file)) { | |
fs.unlinkSync(dir+file) |
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
function initWindowManager() { | |
ipcMain.on('create-window', function(e, arg) { | |
let w = new BrowserWindow(arg[0]) | |
w.loadURL(arg[1]) | |
w.on('closed', function () { | |
w = null | |
}) | |
}) | |
} |
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
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
async function a() { | |
const result = await fetch('https://api.github.com') | |
return result | |
} | |
console.log(a()) |
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
const fetch = require('node-fetch') | |
const url = '' // url | |
let result = [] | |
fetch(url+1).then(res => res.json()).then(res => { | |
const total = res.cardlistInfo.total | |
const arr = [] | |
result = result.concat(res.cards) |
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
{ | |
"af": "Afrikaans", | |
"sq": "Albanian", | |
"ar": "Arabic", | |
"hy": "Armenian", | |
"az": "Azerbaijani", | |
"eu": "Basque", | |
"be": "Belarusian", | |
"bn": "Bengali", | |
"bs": "Bosnian", |
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
{ | |
"af": "Afrikaans", | |
"ar": "Arabic", | |
"bs-Latn": "Bosnian (Latin)", | |
"bg": "Bulgarian", | |
"ca": "Catalan", | |
"zh-CHS": "Chinese Simplified", | |
"zh-CHT": "Chinese Traditional", | |
"hr": "Croatian", | |
"cs": "Czech", |
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="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
ul { | |
margin: 0; | |
padding: 0; |