Skip to content

Instantly share code, notes, and snippets.

@xavierskip
xavierskip / meta.html
Last active October 24, 2020 14:49
对于国内双核浏览器强制使用Webkit内核渲染页面
<meta name="renderer" content="webkit">
//360 6.X 以上可识别
<meta name="force-rendering" content="webkit">
//其他双核可识别
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
//对于没有自带 IE7 内核的浏览器 强制使用用户已安装的最高版本浏览器渲染, 有Chrome框架的优先使用
@xavierskip
xavierskip / say.sh
Created November 15, 2015 07:37
mac say
say --voice="Agnes" Isn\'t it nice to have a computer that will talk to you?
say --voice="Albert" I have a frog in my throat. No, I mean a real frog!
say --voice="Alex" Most people recognize me by my voice.
say --voice="Alice" Salve, mi chiamo Alice e sono una voce italiana.
say --voice="Alva" Hej, jag heter Alva. Jag är en svensk röst.
say --voice="Amelie" Bonjour, je m ’ appelle Amelie. Je suis une voix canadienne.
say --voice="Anna" Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
say --voice="Bad News" The light you see at the end of the tunnel is the headlamp of a fast approaching train.
say --voice="Bahh" Do not pull the wool over my eyes.
say --voice="Bells" Time flies when you are having fun.
@xavierskip
xavierskip / result.txt
Created June 1, 2016 07:22
result of compare
0:0 1.0
0:6 0.886904761905
0:9 0.875
0:8 0.85119047619
0:3 0.809523809524
0:4 0.767857142857
0:2 0.761904761905
0:5 0.75
0:7 0.672619047619
0:1 0.607142857143
@xavierskip
xavierskip / captcha.py
Created June 1, 2016 07:51
a simple captcha hacker tool for example
#!/usr/bin/env python
# coding: utf-8
import requests
import StringIO
from PIL import Image
import os
import time
YES = 'X'
NO = '-'
"""实在是对位运算不熟,甚是麻烦,直接操作字符串了。
"""
def test_rev_encode():
for i in range(500):
encode = rev_encode(i)
if rev_encode(encode) != i:
print('{0}>{1} {1}>{2}'.format(i,encode,rev_encode(encode)))
@xavierskip
xavierskip / 5.1.9.go
Last active March 4, 2017 14:56
gopl.io 5.19 使用panic和recover编写一个不包含return语句但能返回一个非零值的函数
func noReturn() (result int) {
defer func() {
p := recover()
result = p.(int)
}()
panic(42)
}
@xavierskip
xavierskip / inset.go
Last active March 10, 2017 11:41
gopl 6.5 Bit数组 习题
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
// See page 165.
// Package intset provides a set of integers based on a bit vector.
package intset
import (
"bytes"
@xavierskip
xavierskip / auto.js
Last active July 24, 2019 09:08
yun.chinahrt.com的辅助脚本
// 要在console中选择相应的页面
// iframe(play)
window.onfocus = function(){console.log('ononfocus')};
window.onblur = function(){console.log('onblur')};
// 去掉所有的定时器。
var biggestTimeoutId = window.setTimeout(function(){}, 1),i;
for(i = 1; i <= biggestTimeoutId; i++) {
clearTimeout(i);
};console.log('biggestTimeoutId',biggestTimeoutId)
@xavierskip
xavierskip / exercise-equivalent-binary-trees.go
Last active February 7, 2018 08:13
golang tour solutions
package main
import "golang.org/x/tour/tree"
import "fmt"
// Walk 步进 tree t 将所有的值从 tree 发送到 channel ch。
func Walk(t *tree.Tree, ch chan int) {
if t == nil {
return
}