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
char_list = ["adobe-standard-encoding","asmo-708","Big5","Big5-HKSCS","bocu-1","cesu-8","cp1025","cp737","cp851","cp864","cp866","cp875","cp950","csiso2022jp","dos-720","dos-862","euc-cn","EUC-JP","EUC-KR","EUC-TW","GB18030","GB2312","GBK","hp-roman8","hz-gb-2312","ibm-thai","ibm00858","ibm00924","ibm01047","ibm01140","ibm01141","ibm01142","ibm01143","ibm01144","ibm01145","ibm01146","ibm01147","ibm01148","ibm01149","ibm037","ibm1026","ibm1047","ibm273","ibm277","ibm278","ibm280","ibm284","ibm285","ibm290","ibm297","ibm420","ibm423","ibm424","ibm437","ibm500","ibm737","ibm775","IBM850","IBM852","IBM855","IBM857","ibm860","ibm861","IBM862","ibm863","IBM864","ibm865","ibm866","ibm868","ibm869","ibm870","ibm871","ibm880","ibm905","ibm918","ISO-2022-CN","iso-2022-cn-ext","ISO-2022-JP","iso-2022-jp-1","iso-2022-jp-2","ISO-2022-JP-3","ISO-2022-KR","ISO-8859-1","ISO-8859-10","iso-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","iso- | |
885 |
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 | |
from __future__ import unicode_literals, print_function | |
from os.path import split, splitext | |
from optparse import OptionParser | |
from requests import head, post | |
from google import search |
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/irssi | |
# | |
# irssi beep replace script (tested with irssi v0.8.8.CVS (20030126-1726)) | |
# (C) 2002-2004 Ge0rG@IRCnet (Georg Lukas <[email protected]>) | |
# inspired and tested by Macrotron@IRCnet ([email protected]) | |
# added beep_flood to irssi settings: beep_cmd will be run not more often | |
# then every $beep_flood milliseconds | |
# fixed memory leak with timeout_add (made irssi waste 80mb and more after a day of IRC) |
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/dmd -run | |
import std.stdio, std.file, std.path, std.string, std.conv, std.math; | |
struct SwapMap { | |
string pid; | |
double size = 0; | |
string cmd; | |
} |
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 | |
import asyncio | |
import json | |
from aiohttp import ClientSession | |
from lxml import etree | |
from argparse import ArgumentParser | |
from os import mkdir, listdir | |
from execjs import compile as compilejs |
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 | |
import asyncio | |
from http.client import responses | |
from aiohttp.wsgi import WSGIServerHttpProtocol | |
@asyncio.coroutine | |
def foo(env, start_res): | |
start_res( |
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
from tarfile import TarInfo | |
from os import path | |
from io import BytesIO | |
class TarIO: | |
"""Stream Tar IO. | |
>>> from tempfile import gettempdir | |
>>> from tarfile import open as taropen |
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 | |
from sys import argv | |
from sh import ss, grep | |
from requests import get | |
def main(_, port=33445, *__): | |
for ip in map((lambda t: t.strip().split()[-1].split(':')[0]), grep(ss(), "33445")): | |
res = get("http://ip.cn/?ip={}".format(ip), headers={ |
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
"use strict"; | |
var $ = { | |
init: function(d, w){ | |
w.HTMLElement.prototype.on = function(name, foo){ | |
if(this.addEventListener){ | |
this.addEventListener(name, foo, false); | |
}else{ | |
this.attachEvent(`on${name}`, foo); | |
}; |
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
" translate the word under cursor | |
function! SearchWord() | |
echo system('ydcv --', expand("<cword>")) | |
endfunction | |
" translate selected text | |
function! SearchWord_v(type, ...) | |
let sel_save = &selection | |
let &selection = "inclusive" | |
let reg_save = @@ |
OlderNewer