This file contains 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 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 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 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 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 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 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 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
#include <memory> | |
#include <time.h> | |
#include <vector> | |
#include <string> | |
#include <iterator> | |
#include <fstream> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/interprocess/sync/scoped_lock.hpp> |
This file contains 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 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
#include "shaping.h" | |
#ifdef LINUX | |
#include <sys/time.h> | |
#include <time.h> | |
#include <string.h> | |
#include <assert.h> | |
#define OCT_CYCLES_PER_SECOND (1000000ull) |
NewerOlder