Skip to content

Instantly share code, notes, and snippets.


kaidiren kaidiren

Block or report user

Report or block kaidiren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kaidiren /
Last active Dec 31, 2015
Google Authenticator code check (just use for check the code) 谷歌身份验证器上产生的代码验证。不用于产生验证码,只进行验证码验证。
# -*- coding:utf-8 -*-
python 2.7
quote from the next url (python3.X)
View sequelize-transaction-sample.js
'use strict';
const ruo = require('ruo');
exports.complete = function *(id) {
const t = yield ruo.transaction({autocommit: false});
let bill;
try {
bill = yield ruo.models.Bill.findOne({
where: {
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
kaidiren / wait-until-all-es6-promises-complete-even-rejected-promises
Created Jun 2, 2017
Wait until all ES6 promises complete, even rejected promises
View wait-until-all-es6-promises-complete-even-rejected-promises
var a = () => Promise.resolve(1);
var b = () => Promise.reject(new Error(2));
var c = () => Promise.resolve(3);
Promise.all([a(), b(), c()].map(p => p.catch(e => e)))
.then(results => console.log(results)) // 1,Error: 2,3
.catch(e => console.log(e));
View async map
const urls = [1, 2, 3];
async function download(urls) {
return (url) => {
const content = await Promise.resolve(url);
return content;
(async () => {
View fault
kaidiren /
Created Dec 26, 2018 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


kaidiren / vite-send-VTT-by-pow.js
Last active Feb 19, 2019
vite send VTT by pow
View vite-send-VTT-by-pow.js
// node version v10.15.0
// "@vite/vitejs": "^1.1.4",
// "sleep-promise": "^8.0.1"
// output example
// generate account from: vite_b91c215ee845e80744c7d3536c5246724d9bd8938b710e96e9
// generate account to: vite_2118b87c74c01abee0b95e160b4d0e615cc5a22a96e23d50c7
// get some VTT to vite_b91c215ee845e80744c7d3536c5246724d9bd8938b710e96e9
// send some VTT to vite_2118b87c74c01abee0b95e160b4d0e615cc5a22a96e23d50c7
kaidiren / bilibili.ini
Created Mar 9, 2019
supervisor config example
View bilibili.ini
directory=/root/bilibili # 程序目录
command=/root/B/bili/bin/python3 -u # 运行命令
stdout_logfile=/root/B/bili/bilibili-live-record-and-upload/run.log # 日志输出文件
redirect_stderr=true #重定向错误到标准输出
stopwaitsecs=600 #进程停止的等待时间
startretries=60 #重启尝试次数
autostart=true #是否自启动
autorestart=true #是否进程重启
stopasgroup=true #是否使用群组模式,包含有子进程的建议开启
View kebase
### Keybase proof
I hereby claim:
* I am kaidiren on github.
* I am kaidiren ( on keybase.
* I have a public key ASArVcj39KMoU9722ofzcmPjM9tXXbkRXMSsUHypJvq8sAo
To claim this, I am signing this object:
You can’t perform that action at this time.