View aria2jsonrpc.js
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
var ARIA2 = (function() { | |
var jsonrpc_version = '2.0'; | |
function get_auth(url) { | |
return url.match(/^(?:(?![^:@]+:[^:@\/]*@)[^:\/?#.]+:)?(?:\/\/)?(?:([^:@]*(?::[^:@]*)?)?@)?/)[1]; | |
}; | |
function request(jsonrpc_path, method, params) { | |
var request_obj = { | |
jsonrpc: jsonrpc_version, |
View playlist.js
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
var _playlist = []; | |
var _next = ''; | |
var _loading = false; | |
var _loaded = false; | |
var _current = 0; | |
function _load_more() { | |
if (_loading) return; | |
_loading = true; | |
$.get(_next, function(result){ |
View get_pinyin.py
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/env python | |
# -*- encoding: utf-8 -*- | |
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | |
# Author: Binux<roy@binux.me> | |
# http://binux.me | |
# Created on 2014-12-04 00:56:49 | |
def get_py(word): | |
word = word.encode('gbk') |
View logging_receiver
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/env python | |
# -*- coding: utf-8 -*- | |
import cPickle | |
import logging | |
import logging.handlers | |
import SocketServer | |
import struct | |
View adduser.sh
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/bash | |
EMAIL=$1 | |
source vars | |
set -x | |
./pkitool $EMAIL | |
source sendca.sh |
View iframe.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<iframe src="sub_frame.html" width="640" height="480"></iframe> | |
<iframe src="https://httpbin.org/html" width="640" height="480"></iframe> | |
</body> | |
</html> |
View xf_magnet.js
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
// vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8: | |
// Author: Binux<i@binux.me> | |
// http://binux.me | |
// Created on 2013-01-21 20:18:42 | |
jQuery.ajax({ | |
url: 'http://pyproxy.duapp.com/http://httpbin.duapp.com/cookies/set?userid=21', | |
cache: true, | |
dataType: 'script', | |
success: function() { |
View auto_vpn.sh
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 | |
while : | |
do | |
dev=$(ip link | grep state | awk '{ sub(":", "", $2); print $2 }' | grep vpn) | |
if [ $? -ne 0 ]; then | |
sleep 5 | |
continue | |
fi | |
break |
View electron_bug.webRequest.onBeforeSendHeaders.js
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
const {app, BrowserWindow} = require('electron') | |
app.once('ready', async () => { | |
win = new BrowserWindow() | |
win.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => callback({})); | |
win.webContents.once('did-finish-load', async () => { | |
const html = await win.webContents.executeJavaScript('document.documentElement.innerHTML'); | |
console.log(html); | |
app.quit() | |
}) | |
await win.webContents.loadURL('https://httpbin.org/headers', {"extraHeaders":"Addition-Header: hello world"}) |
View pool.py
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/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
import time | |
import Queue | |
import threading | |
import traceback | |
class ExitException(Exception): |
NewerOlder