The repo made me curious, which project reimplementation in Rust.
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
# Trime custom style settings | |
# encoding: utf-8 | |
config_version: "3.0" | |
name: 标准 #方案名称 | |
author: 风花絮 #作者信息 | |
#键盘高度 | |
height: | |
1: &jpgd1 30 #表情键盘 |
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
extern crate nix; | |
use nix::sys::signal; | |
struct Foo; | |
impl Drop for Foo { | |
fn drop(&mut self) { | |
println!("drop."); | |
} |
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 sys import argv | |
from base64 import b64encode | |
print( | |
"\x1b_[14;12;8#{}#{}\u009c".format( | |
b64encode(b"image/png").decode(), | |
b64encode(open(argv[1], "rb").read()).decode() | |
) | |
) |
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 = @@ |
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
#!/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
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 | |
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
#!/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 |
NewerOlder