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
{ | |
// 主题,可以安装 themr 来管理主题 | |
"theme": "Flatland Dark.sublime-theme", | |
// 设置为false时,选择提示的代码按回车或点击可以输出出来,但选择true时不会输出而是直接换行 | |
"auto_complete_commit_on_tab": false, | |
// 设置为true时在当前可视文本视图相应的minimap区域的周围画边框 | |
"draw_minimap_border": true, | |
// 光标淡入淡出 | |
"caret_style": "phase", | |
// 设置为all时所有空格可视,便于区分页面中的空格和TAB。 |
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 fs = require('fs'); | |
var path = require('path'); | |
var exec = require("child_process").exec; | |
var root = '../build/'; | |
var writeFilePath = './urls.txt'; | |
var historyFilePath = './history.txt'; | |
var history = []; | |
var suffix = "http://www.barretlee.com/"; | |
var pushQueue = []; | |
var count = 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
.PHONY: r d b h n i c run backup deploy help new mkfile init clear goroot | |
ROOT = ~/work/blogsys/ | |
DRAFTS = ${ROOT}blog/src/_drafts/ | |
POSTS = ${ROOT}blog/src/_posts/ | |
BACKUPPOSTS = ${ROOT}blogsources/backup/posts/ | |
BACKUPDRAFTS = ${ROOT}blogsources/backup/drafts/ | |
BACKUPPOSTS_BAC = ${ROOT}databackup/posts/ | |
BACKUPDRAFTS_BAC = ${ROOT}databackup/drafts/ |
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 MongoClient = require('mongodb').MongoClient; | |
var mg = require('../config').mongodb; | |
var DB = function(){ | |
this.url = "mongodb://" + mg['host'] + ":" + mg['port'] + "/" + mg['database']; | |
}; | |
module.exports = new DB; | |
DB.prototype.connect = function(cb){ |
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 MongoClient = require('mongodb').MongoClient; | |
var mg = require('../config').mongodb; | |
var DB = function(){ | |
this.url = "mongodb://" + mg['host'] + ":" + mg['port'] + "/" + mg['database']; | |
}; | |
module.exports = new DB; | |
DB.prototype.connect = function(cb){ |
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 db = require('double-bits'); | |
const pad = require('pad'); | |
// [lo, hi] where lo is a 32 bit integer and hi is a 20 bit integer. | |
const base2Str = (n) => { | |
const f = db.fraction(n); | |
const s = db.sign(n) ? '-' : ''; | |
const e = `2^${db.exponent(n) + 1}`; | |
const t = `0.${pad(f[1].toString(2), 20, '0')}${pad(f[0].toString(2), 32, '0')}`; | |
return `${s}${e} * ${t}`; |
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
# atom-sync |
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
<script src="http://cdn.staticfile.org/socket.io/1.3.7/socket.io.js"></script> | |
<script src="http://cdn.staticfile.org/jquery/2.2.1/jquery.min.js"></script> | |
<script> | |
function htmlspecialchars(str){ | |
str = str || ''; | |
str = str.replace(/&/g, '&'); | |
str = str.replace(/</g, '<'); | |
str = str.replace(/>/g, '>'); | |
str = str.replace(/"/g, '"'); |
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 fs = require('fs'); | |
const request = require('request'); | |
const BASE = 'https://api.xiaomiquan.com/v1.2/groups/4512888248/topics'; | |
const ORIGIN = 'https://wx.xiaomiquan.com'; | |
const REFERER = 'https://wx.xiaomiquan.com/dweb/'; | |
const UA = 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36'; | |
const AUTHORIZATION = 'xxx'; | |
const pageSize = '?count=20'; | |
const end_time = (t) => t ? `&end_time=${encodeURIComponent(t)}` : t; |
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
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
# @author weishu @2015/12/7 | |
import subprocess | |
import os | |
import re | |
import json |