Skip to content

Instantly share code, notes, and snippets.

@varequan
varequan / gist:6f3dc27b9025ae022a19786b0f214658
Created August 21, 2019 03:06
jquery实时搜索限制ajax发送频率
function getSearchText(){
var btn = true
$('.searchContent').off('input').on('input',function(){
if(timer){
clearTimeout(timer)
}
if(!btn){
return;
}
btn = false;
@varequan
varequan / test.html
Last active March 28, 2018 06:24
test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Js复制代码</title>
</head>
<body>
<p>
<input type="button" name="anniu1" onClick='copyToClipBoard()' value="复制专题名称和url地址,传给QQ/MSN上的好友">
<script language="javascript">
@varequan
varequan / exam.py
Created March 3, 2018 17:23
刑侦科推理试题程序作答
#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
i=0
option=['o','a','b','c','d']
for a in xrange(1,5):
for b in xrange(1,5):
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import os
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode