用户管理:
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
#!/usr/bin/env bash | |
ProjectName="sundries" # 项目名称 | |
Port=3030 # 服务监听端口 , 通过设置 NODE_PORT 环境变量实现 | |
CleanNodeModules=true # 是否每次都清除 node_modules | |
NodeVersion=8.1.2 # node 版本, 需确保 nvm 有该版本 | |
Restart=true # 是否每次都重启服务 | |
if [[ -e $1 ]]; then |
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
/** | |
* SMS services. | |
*/ | |
"use strict"; | |
const http = require("http"); | |
const URL = require("url"); | |
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 strict'; | |
var koa = require('koa'); | |
var bodyParse = require('koa-bodyparser'); | |
var app = new koa(); | |
app.use(function *(next) { | |
let bodyData = []; | |
this.req.on('data', (chunk) => { |
当前分支上, 本地已经有多个 commit 了. 此时想将这些零散的 commit 合并成一个.
context menu -> git -> repository -> rebase
勾选 interactive
onto 选定的是 remote 上对应当前本地分支的分支. 如 refs/remotes/origin/master
from 什么都不选
使用工具: pyamsoft/pstate-frequency
example :
# set max cpu freq to 60%
sudo pstate-frequency -d -S -m 60
echo -n "test message" | nc -4u -w1 [host] [udp port]
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
# Rime alternative settings | |
# encoding: utf-8 | |
# | |
# difference from default settings: | |
# 1. ascii-style punctuation in half-shape mode | |
# 2. [ ] as paging keys | |
# | |
# save this file as: | |
# (Linux) ~/.config/ibus/rime/alternative.yaml | |
# (Mac OS) ~/Library/Rime/alternative.yaml |
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 strict'; | |
const zlib = require('zlib'); | |
const orgStr = 'Node is similar in design to, and influenced by, systems like Ruby\'s Event Machine or Python\'s Twisted. Node takes the event model a bit further, it presents an event loop as a runtime construct instead of as a library. In other systems there is always a blocking call to start the event-loop. Typically behavior is defined through callbacks at the beginning of a script and at the end starts a server through a blocking call like EventMachine::run(). In Node there is no such start-the-event-loop call. Node simply enters the event loop after executing the input script. Node exits the event loop when there are no more callbacks to perform. This behavior is like browser JavaScript — the event loop is hidden from the user.HTTP is a first class citizen in Node, designed with streaming and low latency in mind. This makes Node well suited for the foundation of a web library or framework.Just because Node is designed without threads, doesn\'t mean you canno |
NewerOlder