Skip to content

Instantly share code, notes, and snippets.

@shenyubao
shenyubao / BanksiteItem.py
Created October 31, 2014 03:27
DealerSpider
from scrapy.item import Item, Field
class BanksiteItem(Item):
# define the fields for your item here like:
# name = Field()
id = Field()
bank = Field()
province = Field()
city = Field()
name = Field()
@shenyubao
shenyubao / Omnifocus2Text.sh
Created October 22, 2013 01:45
Get Text From Omnifocus. (used in Geektools)
#!/bin/sh
# Ver 0.02
# Changes the handling of time zones
OFOC="com.omnigroup.OmniFocus"
if [ ! -d "$HOME/Library/Caches/$OFOC" ]; then OFOC=$OFOC.MacAppStore; fi
OFQUERY="sqlite3 $HOME/Library/Caches/$OFOC/OmniFocusDatabase2"
TODAY=$(date -v0H -v0M -v0S +%s) #Midnight at the start of today: set the time component to 00:00
NOW=$(date +%s) # the date command automatically allows for daylight savings like BST in the UK
DAY=86400;
@shenyubao
shenyubao / GeekTools.as
Created October 20, 2013 14:01
link GeekTools With Evernote
// 脚本内容
// 注意修改脚本17行中的路径 与15行中的tag
tell application "System Events"
set processList to (name of processes)
end tell
if processList does not contain "Evernote" then
tell application id "com.evernote.evernote"
activate
@shenyubao
shenyubao / vim74Install.sh
Created September 23, 2013 07:47
Vim 7.4 Install script.
#!/bin/bash
# By Shenyubao <ssybb1988@gmail.com>
VIM_VERSION=$(vim --version | grep IMproved | awk '{print $5}')
if [ $VIM_VERSION = "7.4" ];then
echo "this is already vim 7.4"
exit;
fi
confirm() {
@shenyubao
shenyubao / prober.php
Created September 19, 2013 18:13
常用PHP探针
<?php
error_reporting(0); //抑制所有错误信息
@header("content-Type: text/html; charset=utf-8"); //语言强制
ob_start();
$title = "Yahei-PHP Prober";
$version = "v0.3.5"; //版本号
define('HTTP_HOST', preg_replace('~^www\.~i', '', $_SERVER['HTTP_HOST']));
<?php
/***
* 加密函数(密文具有有效期,可逆,根据时间生成不同的密文)
* @param $string
* @param string $operation
* @param string $key
* @param int $expiry
* @return string
*/
@shenyubao
shenyubao / IPCheck.php
Last active January 19, 2016 10:52
Check whether the IP belongs to china.
<?php
class IP_Check{
private $ip_china = array(
array(167772160,184549375), //10.0.0.0~10.255.255.255
array(2886729728,2887778303), //172.16.0.0~172.31.255.255
array(3232235520,3232301055), //192.168.0.0~192.168.255.255
array(17563648, 17825791),
array(18350080, 18874367),
array(453509120, 455081983),
array(455344128, 456130559),