Skip to content

Instantly share code, notes, and snippets.

@Clarence-pan
Clarence-pan / jsfiddle.md
Last active July 18, 2018 08:56
Accordion 手风琴效果
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 March 3, 2022 11:33
微信跳一跳, 你懂得
/*
* 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 November 2, 2017 05:43
多边形文本区域,自动换行,自动裁剪,沿着多边形来排版
<!doctype html>
<html>
<head>
<style>
.main {
width: 13em;
text-align: center;
}
.left, .right {
@Clarence-pan
Clarence-pan / number_format.js
Created October 31, 2017 02:23 — forked from ricardoriogo/number_format.js
Javascript version of php number_format function
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)
@Clarence-pan
Clarence-pan / crach.py
Created September 30, 2017 09:08
CrackGeetest
#-*- 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 September 27, 2017 10:00
并行测试并获取素数
package main
import (
"bytes"
"fmt"
"log"
"runtime"
"strconv"
"time"
)
@Clarence-pan
Clarence-pan / test.html
Created September 25, 2017 05:45
Canvas绘制点点点
<!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 September 13, 2017 06:26
获取go-routine的ID的方法
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 August 31, 2017 03:13
HTML中嵌入svg图片的N种方式
<!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"