Skip to content

Instantly share code, notes, and snippets.

View quininer's full-sized avatar
®️
Work with Rust.

quininer quininer

®️
Work with Rust.
View GitHub Profile
# Trime custom style settings
# encoding: utf-8
config_version: "3.0"
name: 标准 #方案名称
author: 风花絮 #作者信息
#键盘高度
height:
1: &jpgd1 30 #表情键盘
@quininer
quininer / handle_oom.rs
Created October 19, 2016 07:25
Rust handle oom
extern crate nix;
use nix::sys::signal;
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {
println!("drop.");
}
@quininer
quininer / README.md
Last active August 3, 2016 04:04
Which project reimplementation in Rust.

Which project reimplementation in Rust

The repo made me curious, which project reimplementation in Rust.

Completed or nearing completion

@quininer
quininer / print_image.py
Created February 19, 2016 15:34
working on notty
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()
)
)
@quininer
quininer / ydcv.vim
Created November 3, 2015 03:22
ydcv on vim
" 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 = @@
@quininer
quininer / ice.js
Created September 16, 2015 16:59
JavaScript basic library.
"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);
};
@quininer
quininer / toxlookip.py
Last active September 1, 2015 16:56
观察你都连接到了哪些 Tox node.
#!/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={
@quininer
quininer / tarstream.py
Last active September 7, 2015 12:10
Tar Stream.
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
@quininer
quininer / test.py
Created August 1, 2015 09:40
aiohttp wsgi PATH_INFO parse Error.
#!/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(
@quininer
quininer / u17get.py
Last active September 13, 2022 01:38
抓取u17漫画
#!/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