Skip to content

Instantly share code, notes, and snippets.

View Dafrok's full-sized avatar
🏳️‍🌈
正在变基

Dafrok Dafrok

🏳️‍🌈
正在变基
View GitHub Profile
const defaultManagerUrl = 'https://openapi.iqiyi.com';
const defaultUploadUrl = 'https://upload.iqiyi.com';
class QiyiSdk {
constructor(options = {}) {
const {
appKey,
appSecret,
managerUrl,
uploadUrl,
const defaultManagerUrl = 'https://openapi.iqiyi.com';
const defaultUploadUrl = 'https://upload.iqiyi.com';
class QiyiSdk {
constructor(options = {}) {
const {
appKey,
appSecret,
managerUrl,
uploadUrl,
var reg1 = getRegExp('\[[\'\"]', 'g');
var reg2 = getRegExp('[\'\"]\]', 'g');
function deepGet(object, path, defaultValue) {
var pathAry = path.replace(reg1, '.').replace(reg2, '').split('.');
if (pathAry[0] === '') {
pathAry.shift();
}
return pathAry.reduce(function (o, k) {
return o && o[k];
@Dafrok
Dafrok / pack.js
Last active November 13, 2018 08:00
/**
* @file 在内存中打包 zip 文件的类,需要设置 `/var/run/${namespace}` 的权限为777
* @author o.o@mug.dog
*/
import * as fs from 'fs';
import * as path from 'path';
import * as mkdirp from 'mkdirp';
import * as archiver from 'archiver';
import * as copydir from 'copy-dir';
@Dafrok
Dafrok / gender.js
Last active November 12, 2018 10:28
const id = '4199292455301996'
let page = 0
async function getUidList() {
const result = []
let isEnd = false
while (!isEnd) {
const response = await fetch(`/api/comments/show?id=${id}&page=${page}`).then(res => res.json())
if (response.data) {
const data = response.data.data
@Dafrok
Dafrok / ta.js
Last active September 15, 2017 02:31
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!
@Dafrok
Dafrok / timeDec.js
Last active September 14, 2017 08:43
function timeDec(t1, t2) {
const DAY = 24 * 60 * 60 * 1000
const SPACING = DAY * 7 / 24
const t = d => ((r = new Date(d), (22<= r < 6) ? new Date(r.setHours(22)) : r >= 0 ? new Date(r - DAY) : new Date(r)).getTime())
const dec = t(t1) - t(t2)
return Math.abs(dec- ((dec / DAY) | 0) * SPACING)
}
git pull origin pull/28/head
# or
git fetch origin pull/28/head:28
git checkout 28
git filter-branch --env-filter '
OLD_EMAIL="OLD_EMAIL"
CORRECT_NAME="Dafrok"
CORRECT_EMAIL="o.o@mug.dog"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
const http = require('http')
const fs = require('fs')
const path = require('path')
const STEP = 50
const MAX = 65536
const file = {}
const getKana = range => new Promise((resolve, reject) => {
let text = ''