Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Feix C feix

💭
I may be slow to respond.
  • Beijing
View GitHub Profile
@feix
feix / RexChainesPhone.js
Created Apr 9, 2020 — forked from JerryC8080/RexChainesPhone.js
匹配中国电话号码的正则表达式
View RexChainesPhone.js
/**
电信
中国电信手机号码开头数字
2G/3G号段(CDMA2000网络)133、153、180、181、189
4G号段 177
联通
中国联通手机号码开头数字
@feix
feix / bankCard.js
Created Apr 9, 2020 — forked from yanweijia/bankCard.js
匹配国内主流银行卡的正则
View bankCard.js
let bankcardList = [{
bankName: "中国邮政储蓄银行",
bankCode: "PSBC",
patterns: [{
reg: /^(621096|621098|622150|622151|622181|622188|622199|955100|621095|620062|621285|621798|621799|621797|620529|621622|621599|621674|623218|623219)\d{13}$/g,
cardType: "DC"
}, {
reg: /^(62215049|62215050|62215051|62218850|62218851|62218849)\d{11}$/g,
cardType: "DC"
}, {
View read_mysqld_myd.py
#!/usr/bin/env python3
# https://dev.mysql.com/doc/internals/en/layout-record-storage-frame.html
def read_len(content, begin, l):
sum_len = 0
for bit in content[begin:begin+l]:
sum_len = (sum_len << 8) + bit
return sum_len
View read_mysqld_myd.lua
-- https://dev.mysql.com/doc/internals/en/layout-record-storage-frame.html
local read_len = function(content, first, l)
local sum = 0
local last = first + l - 1
for i = first, last do
sum = sum * 256 + content[i]
end
return sum
end
View ancient-earth_gif.sh
#!/bin/bash
echo "download beginning"
years=$(curl -s http://dinosaurpictures.org/ancient-earth | grep option | awk -F'"' '$0 ~ /million|>0</ {print $2}')
base_url=http://dinosaurpictures.org/ancient-earth-assets/images/scotese/
target_path=earth_pics
mkdir -p "$target_path"
IFS=$'\n'
@feix
feix / tcp_timeout.go
Created Jun 12, 2018 — forked from hongster/tcp_timeout.go
Golang example on handling TCP connection and setting timeout.
View tcp_timeout.go
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
View unwxapkg.py
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
View wx_t1t_hack.js
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
You can’t perform that action at this time.