Skip to content

Instantly share code, notes, and snippets.

{"sig":"676858f66a387ba59a102c96ed351cc260636d7dbf52b0aacd3559ff73831daff05458fe33a93ad6fa2cb00f7e7b254a28c8087ab325c545c2e4876214f08da1","msghash":"928f9d90fe7ab63c9b5c2e2b6e32351f05be4db5d4e0e8fc1ab9df7bd9da4ad9"}
@xufan6
xufan6 / zjzx.py
Last active October 17, 2023 06:25
浙江省高校师资培训练习系统-题目抓取以及去重
from bs4 import BeautifulSoup
import re
for a in xrange(1,5):
for b in xrange(1,21):
path="html/"+str(a)+"_"+str(b)+".html"
soup = BeautifulSoup(open(path),"lxml")
span=soup.find_all(id=re.compile("Label"))
for i in span:
#print i.get("id")
// ==UserScript==
// @id iitc-plugin-sh-enl-target-drawer@Breezewish
// @name IITC plugin: Draw Shanghai Enlightened Target Portals
// @description Draw target portals by SH ENL
// @author Breezewish
// @category Layer
// @version 0.0.4.20140619.203600
// @updateURL https://gist.githubusercontent.com/breeswish/7e8e0d8628a4615afe59/raw/iitc-plugin-sh-enl-target-drawer.meta.js
// @downloadURL https://gist.githubusercontent.com/breeswish/7e8e0d8628a4615afe59/raw/iitc-plugin-sh-enl-target-drawer.user.js
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
plugin.enltarget.draw_guardian([
{
"lat": 29.65357,
"lng": 115.943885,
"time": 1368429231432,
"days": 380,
"player": "honesty",
"title": "九江市生命活水医院",
"guid": "ade47c22469242b2b97957cbcda2682c.11"
},
#!/bin/bash -x
SRC=/home/xf/git/Hotot/data/
DEST=/opt/www/hotot/
echo "\033[1;31;40m[i]Sync ...\033[0m"
# ignore .*.swp, .hgignore, etc
rsync -av --exclude '.*.*' --exclude '*.coffee' --exclude 'test*' $SRC $DEST
# replace conf.vars.platform, key and secret
echo "\033[1;31;40m[i] Replace platform, key and secret ...\033[0m"
  • Arts & Entertainment Arts & Entertainment * Arcade Arcade * Art Gallery Art Gallery * Bowling Alley Bowling Alley * Casino Casino * Comedy Club Comedy Club * General Entertainment General Entertainment * Historic Site Historic Site * Movie Theater Movie Theater
<!DOCTYPE HTML>
<html><head><meta charset=utf-8 /><title>4sq categories</title></head><body>
<ul>
<li><img src="https://foursquare.com/img/categories/arts_entertainment/default_32.png" />Arts & Entertainment</li>
<ul>
<li> <img src="https://foursquare.com/img/categories/arts_entertainment/arcade_32.png" />Arcade</li>
<li> <img src="https://foursquare.com/img/categories/arts_entertainment/artgallery_32.png" />Art Gallery</li>
<li> <img src="https://foursquare.com/img/categories/arts_entertainment/bowling_32.png" />Bowling Alley</li>
@xufan6
xufan6 / 4sq_categories.py
Created April 29, 2012 16:50
4sq categories
#/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,urllib2,codecs
try: import simplejson as json
except ImportError: import json
CLIENT_ID="IYLVVWKAC110IENAZ53BJJUJEIDOSK5SVKKLDPAVLCHRLO45"
CLIENT_SECRET="KPW0QHUC2125TSWNZFLMHYXHHAN3BGXZRVZQYO5JS1RUZ3WS"
url="https://api.foursquare.com/v2/venues/categories?client_id="+CLIENT_ID+"&client_secret="+CLIENT_SECRET+"&v=20120615"
#url="file:///tmp/categories"
@xufan6
xufan6 / gist:1867900
Created February 20, 2012 04:46
全角转半角的js
<html>
<textarea name="n" type="text" id="n" onkeyup="CtoH(this);" style="width:100%;height:100%;"></textarea>
<SCRIPT>
function CtoH(obj){
var str=obj.value;
var result="";
for (var i = 0; i < str.length; i++){
if (str.charCodeAt(i)==12288){
result+= String.fromCharCode(str.charCodeAt(i)-12256);
continue;