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
/** | |
* Suds: A Lightweight JavaScript SOAP Client | |
* Copyright: 2009 Kevin Whinnery (http://www.kevinwhinnery.com) | |
* License: http://www.apache.org/licenses/LICENSE-2.0.html | |
* Source: http://github.com/kwhinnery/Suds | |
*/ | |
function SudsClient(_options) { | |
function isBrowserEnvironment() { | |
try { | |
if (window && window.navigator) { |
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
// 2012 new version | |
// 点击logo到广播 | |
$('.site-nav-logo a').attr('href', 'http://www.douban.com/update/'); | |
// 按"."刷新广播,与twitter快捷键一致 | |
$('body').keypress( | |
function (e) { | |
var code = e.charCode ? e.charCode : e.keyCode; | |
if (code === 46 && !$(':focus').is(':input')) { | |
// '.' to reload |
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/bash | |
VPN_SERVICENAME="l2tpd" | |
VPN_PSK="fuckgfw" | |
VPN_IPRANGE="10.1.100" | |
VPN_USERNAME="fill in your username" | |
VPN_PASSWORD="your password" | |
#L2TPD/IPSEC |
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
if (!pluginnetwork) var pluginnetwork = {}; | |
var failcount = 0; | |
pluginnetwork.contentscript = function () { | |
return { | |
isMarketingEnabled: function () { | |
if (pluginnetwork.pluginStorage.getItem(pluginnetwork.GLOBALS.PLUGIN_NAMESPACE + '.marketing') == "false") { | |
return false; | |
} else { | |
return true; | |
} |
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
r1 = {'a': {'q': 1, 'w': 2}, 'b': {'q': 3, 'w': 4}} | |
r2 = {'a': {'q': 5, 'w': 7}, 'b': {'q': 8, 'w': 2}} | |
# ret = {'a': {'q': 6, 'w': 9}, 'b': {'q': 11, 'w': 6}} | |
def iter_dict(x, y): | |
if not isinstance(x, dict): | |
return map(lambda x: sum(x), zip(x, y)) | |
if isinstance(x.values()[0], dict): | |
return dict(zip(x.keys(), map(lambda x:iter_dict(x[0], x[1]), zip(x.values(), y.values())))) | |
return dict(zip(x.keys(), iter_dict(x.values(), y.values()))) |
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
require 'sinatra' | |
require 'oauth' | |
API_KEY = '' | |
API_SECRET = '' | |
token = '' | |
secret = '' | |
post '/miniblog' do | |
content = params[:content] |
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
var exposeEd2kCon = $('<input class="button" type="button" value="显示选中链接" style="background-color:#C30604; color:#FFFFFF"/>').click( | |
function () { | |
var output = ''; | |
for(var i = 0,array = document.querySelectorAll('.hover.filebox')[0].querySelectorAll('li'); i<array.length-1; i++){ | |
if(array[i].querySelector('input').checked && array[i].querySelector('a').href.length > 0 && array[i].querySelector('a').href.match('-----') === null){ | |
output += array[i].querySelector('a').href + '\n'; | |
} | |
} | |
if (!$('#ed2kexpwin').length) { | |
$('body').append('<div id="ed2kexpwin" style="width:656px;height:168px;left:30px;bottom:0;position:fixed;overflow:scroll;visibility:visible;background-color:#fff;text-align:left;"><textarea rows="8" cols="90"></textarea></div>'); |
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(){ | |
var output = ''; | |
for(var i = 0,array = document.querySelectorAll('.hover.filebox')[0].querySelectorAll('li'); i<array.length-1; i++){ | |
if(array[i].querySelector('input').checked && array[i].querySelector('a').href.length > 0 && array[i].querySelector('a').href.match('-----') === null){ | |
output += array[i].querySelector('a').href + '\n'; | |
} | |
} | |
copy(output); | |
})(); |
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
#ab -r -n 10000 http://127.0.0.1:8880/hello/world | |
#You have to run Sentry at 127.0.0.1:8000 and replace the following DSN. | |
from bottle import route, run | |
@route('/hello/:name') | |
def index(name='World'): | |
from raven import Client | |
client = Client('http://5a77e2293b2e441188dcd03180e47e6d:[email protected]:8000/2') | |
client.captureMessage('hello world!') |
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
#-*- coding:utf-8 -*- | |
from optparse import OptionParser | |
from pyapns import configure, provision, notify, feedback | |
def send_notify(host, app, cert, token, string, is_feedback): | |
print 'Sending...\nhost: %s\napp: %s\ndevice: %s\nstring: %s' % (host, app, token, string) | |
configure({'HOST': host}) | |
if cert: | |
provision(app, open(cert).read(), 'sandbox') | |
notify(app, token, {'aps':{'alert': string}}) |
OlderNewer