Skip to content

Instantly share code, notes, and snippets.

Avatar

Clarence Pan Clarence-pan

View GitHub Profile
@Clarence-pan
Clarence-pan / jsfiddle.md
Last active Jul 18, 2018
Accordion 手风琴效果
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)
@Clarence-pan
Clarence-pan / hack.js
Last active May 7, 2019
微信跳一跳, 你懂得
View hack.js
/*
* Recommend run with node v8.9.x or higher version
* npm install lodash crypto-js request-promise request
* node hack.js
*/
const version = 5 // the version of t1t
const score = 370 // the score you wanna get
const playTimeSeconds = score * 0.01 // simulate the playing time (seconds)
@Clarence-pan
Clarence-pan / 0_test.html
Created Nov 2, 2017
多边形文本区域,自动换行,自动裁剪,沿着多边形来排版
View 0_test.html
<!doctype html>
<html>
<head>
<style>
.main {
width: 13em;
text-align: center;
}
.left, .right {
@Clarence-pan
Clarence-pan / number_format.js
Created Oct 31, 2017 — forked from ricardoriogo/number_format.js
Javascript version of php number_format function
View number_format.js
function number_format (number, decimals, dec_point, thousands_sep) {
// http://kevin.vanzonneveld.net
// + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfix by: Michael White (http://getsprink.com)
// + bugfix by: Benjamin Lupton
// + bugfix by: Allan Jensen (http://www.winternet.no)
// + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// + bugfix by: Howard Yeend
// + revised by: Luke Smith (http://lucassmith.name)
View crach.py
#-*- coding:utf-8 -*-
# from Python3WebSpider/CrackGeetest
# and did some little changes to fix python2
import time
from io import BytesIO
from PIL import Image
from selenium import webdriver
from selenium.webdriver import ActionChains
@Clarence-pan
Clarence-pan / test-prime.go
Created Sep 27, 2017
并行测试并获取素数
View test-prime.go
package main
import (
"bytes"
"fmt"
"log"
"runtime"
"strconv"
"time"
)
@Clarence-pan
Clarence-pan / test.html
Created Sep 25, 2017
Canvas绘制点点点
View test.html
<!DOCTYPE html>
<html>
<!-- ![](http://ww1.sinaimg.cn/large/006Vei6ogy1fjvra56p89j312b0n044h.jpg) -->
<head>
<meta charset="UTF-8">
<title></title>
<style>
* {
margin: 0;
padding: 0;
@Clarence-pan
Clarence-pan / go-routine-id.go
Last active Sep 13, 2017
获取go-routine的ID的方法
View go-routine-id.go
func getGoRoutineId() uint64 {
b := make([]byte, 32)
b = b[:runtime.Stack(b, false)]
b = bytes.TrimPrefix(b, []byte("goroutine "))
b = b[:bytes.IndexByte(b, ' ')]
id, err := strconv.ParseUint(string(b), 10, 64)
if err != nil {
log.Panicf("Cannot parse goroutine id from %v: %v", b, err)
}
@Clarence-pan
Clarence-pan / test.html
Last active Aug 31, 2017
HTML中嵌入svg图片的N种方式
View test.html
<!doctype html>
<html>
<head><title>嵌入SVG图片的N种方式</title></head>
<body>
<h3>0. 使用`svg`标签</h3>
<svg version="1.1"
preserveAspectRatio="xMinYMin meet"
viewBox="0 0 660 342"
width="660" height="342"
xmlns="http://www.w3.org/2000/svg"