Skip to content

Instantly share code, notes, and snippets.

Yifei Kong yifeikong

Block or report user

Report or block yifeikong

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
yifeikong / yijianjiexi.js
Created Jun 1, 2019
View yijianjiexi.js
const puppeteer = require('puppeteer');
const SCRIPTS = [
`() => {
Object.defineProperty(navigator, 'webdriver', {
get: () => false,
`() => {
// We can mock this in as much depth as we need for the test.
#!/usr/bin/env python
# coding: utf-8
import requests
def main():
r ='http://localhost:8080/api', json={'foo': 'bar'})
if __name__ == "__main__":
import time
import logging
import zbar
from PIL import Image, ImageEnhance, ImageFilter
def timing(f):
def wrap(*args):
time1 = time.time()
ret = f(*args)
time2 = time.time()
# 刷新朋友圈
ssh root@$IP 'kill `pgrep`'
ssh root@$IP am start -n
# 调用WeChatMomentStat获取all_sns.json
# 暂时手动触发
brew install android-ndk
export NDK_VERSION='r13'
export NDK=/usr/local/Cellar/android-ndk
export GCC_VERSION='4.9'
export ANDROID_VERSION='21' # android 5.0
export ARCH='arm'
export PATH=$PATH:$NDK/$NDK_VERSION/toolchains/$ARCH-linux-androideabi-$GCC_VERSION/prebuilt/darwin-x86_64/bin
View get_bucket.lua
if not redis.pcall('exists', KEYS[1]) then
return 1
local bucket_name = KEYS[1]
local current_time = ARGV[1]
-- bucket {rate, timespan, last_check, tokens}
local rate = redis.pcall('hget', bucket_name, 'rate')
local timespan = redis.pcall('hget', bucket_name, 'timespan')
#!/usr/bin/env bash
# Save and restore the state of tmux sessions and windows.
# TODO: persist and restore the state & position of panes.
set -e
dump() {
local d=$'\t'
tmux list-windows -a -F "#S${d}#W${d}#{pane_current_path}"
yifeikong /
Created Feb 22, 2018
remove emoji in python
#!/usr/bin/env python
# coding: utf-8
import re
text = u'This dog \U0001f602'
print(text) # with emoji
def remove_emoji(data):
if not data:
<title>There are more than one spaces " "</title>
<h1>h1: There are more than one spaces " "</h1>
<p>p: There are more than one spaces " "</p>
<pre>pre: There are more than one spaces " "</pre>
You can’t perform that action at this time.