This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# $Id: weiboPm.py,v 1.0 2013/04/26 12:00:00 $ | |
import sys,os,xmpp,time | |
USER=r"123456\40qq.com" | |
PASSWORD="secret" | |
RECEIVER=['123456@weibo.com'] | |
def sendWeiboMsg(receivers, message): | |
jidparams={} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import socket | |
import ssl | |
import json | |
import struct | |
import argparse | |
APNS_HOST = ( 'gateway.sandbox.push.apple.com', 2195 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __DUMP_HEX_HEADER__ | |
#define __DUMP_HEX_HEADER__ | |
#define DH_NUM_BYTES_PER_LINE 16 | |
#define DH_HEX_POS 46 | |
#define DH_HEX_OFFSET 6 | |
#define DH_HEX_COLUMN_SIZE 8 | |
#define DH_SEPERATOR ' ' | |
#define DH_UNPRINTABLE '.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __JeAllocator__HEADER__ | |
#define __JeAllocator__HEADER__ | |
#define JEMALLOC_NO_DEMANGLE 1 | |
#include "jemalloc/jemalloc.h" | |
template<typename T> | |
class JeAllocator { | |
public : | |
// typedefs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function regExpMatch(url, pattern) { | |
try { return new RegExp(pattern).test(url); } catch(ex) { return false; } | |
} | |
function FindProxyForURL(url, host) { | |
url = url.toLowerCase(); | |
host = host.toLowerCase(); | |
var proxy = "PROXY 1.1.1.1:8999"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Monitoring per-process disk I/O activity | |
# written by http://www.vpsee.com | |
import sys, os, time, signal, re | |
class DiskIO: | |
def __init__(self, pname=None, pid=None, reads=0, writes=0): | |
self.pname = pname | |
self.pid = pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if test $# -ne 1; then | |
echo "Usage: `basename $0 .sh` PROGRAM" 1>&2 | |
exit 1 | |
fi | |
GDB=${GDB:-gdb} | |
if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CreditCard: { | |
TEST_NUMBERS: $w('378282246310005 371449635398431 378734493671000 30569309025904 38520000023237 6011111111111117 6011000990139424 5555555555554444 5105105105105100 4111111111111111 4012888888881881 4222222222222'), | |
isValid: function(number){ | |
if (number.blank()) return false; | |
if (Braintree.CreditCard.TEST_NUMBERS.include(number)) return false; | |
var total = ($A(number).reverse().inject(0, function(a, n, index) { | |
return a + $A((parseInt(n) * [1, 2][index % 2]).toString()).inject(0, function(b, o) { | |
return b + parseInt(o); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This is a script that help you get your team member's productivity | |
# by analyzing his/her code commiting in SVN repository, for the day before | |
# | |
# You can get a rough num for comparing between team members by using it in the way below | |
# ./svn_ana.sh SVN_ACCOUNT_NAME | wc -l | |
# | |
uname=vr | |
password=reader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ts=2 sw=2 | |
set hlsearch | |
syntax on | |
set fileencodings=ucs-bom,utf-8,cp936 | |
if has("gui_macvim") | |
set gfn=Monaco:h13 | |
set transparency=8 | |
colorscheme desert | |
set go=egmt |