#Installing ngrok on OSX
- Download ngrok
- Unzip it to your Applications directory
- Create a symlink (instructions below)
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory#Installing ngrok on OSX
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory| #!/usr/bin/env bash | |
| set -e | |
| # allow being run from somewhere other than the git rootdir | |
| gitroot=$(git rev-parse --show-cdup) | |
| # default gitroot to . if we're already at the rootdir | |
| gitroot=${gitroot:-.}; | |
| nm_bin=$gitroot/node_modules/.bin |
| yum install -y m2crypto python-setuptools | |
| yum install -y python-pip | |
| pip install shadowsocks | |
| vim /etc/shadowsocks.json | |
| { | |
| "server":"0.0.0.0", | |
| "server_port":8388, | |
| "local_port":1080, | |
| "password":"passwd", | |
| "timeout":600, |
| ''' | |
| moving avg,就是一个stream输入, | |
| 给一个int getNow()API获取当前timestamp, | |
| 完成两个函数void record(int value)和double getAvg(), | |
| 有输入时会自动call record,然后call getAvg()时返回5分钟内的平均值。 | |
| getMedium -> quick select | |
| ''' | |
| from collections import deque |
| def summmaryranges(nums): | |
| ranges = [] | |
| for num in nums: | |
| if not ranges or num - ranges[-1][-1] > 1: | |
| ranges.append([]) | |
| ranges[-1][1:] = [num] | |
| return ['->'.join(map(str, r)) for r in ranges] | |
| def reverse(l, r, cl): | |
| while l < r: |
| function skipOne(): Promise<void> { | |
| return new Promise(((resolve, reject) => { | |
| setTimeout(resolve, 0) | |
| })) | |
| } | |
| export class TaskManagerPromise<T> extends Promise<T> { |