Skip to content

Instantly share code, notes, and snippets.

View 12101111's full-sized avatar

韩朴宇 12101111

  • 哈尔滨工业大学物联网与泛在智能研究中心
  • harbin
View GitHub Profile
@-moz-document url("chrome://browser/content/browser.xhtml") {
:root {
--proton-tab-block-margin: 0px !important;
--arrowpanel-menuitem-padding-block: 4px 4px !important;
--tab-min-height: 26px !important;
--panel-separator-margin: 2px 4px;
--toolbarbutton-outer-padding: 1px !important;
--toolbarbutton-inner-padding: 3px !important;
--urlbar-container-padding: 0px !important;
}
@12101111
12101111 / main.rs
Last active August 27, 2020 06:46
rustfmt can't format it
use warp::{reject::Rejection, Filter};
#[tokio::main]
async fn main() {
let echo = warp::get().and(warp::path::param())
.and_then(
|path: String| async move {
let body = format!(r##"<!DOCTYPE html><html><head><meta charset="utf-8"><title>{}</title></head><body>Echo: {}</body></html>"##, path,path);
Ok::<_ ,Rejection>( warp::reply::html(body))
},
);
@12101111
12101111 / gh-check
Created April 16, 2020 06:22 — forked from lilydjwg/gh-check
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@12101111
12101111 / config
Created February 10, 2020 12:39
config for minimal aarch64 linux which can boot from qemu
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.5.2 Kernel Configuration
#
#
# Compiler: Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports ced1a8b8b4b8d904ee0239c12b4d72699eb89493) (based on LLVM 9.0.1)
#
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
@12101111
12101111 / enum_serde_diesel.rs
Last active August 23, 2018 10:09
use enum in diesel
/// Useage:
/// enum_serde_diesel!(Example {
/// a = 0,
/// b = 1,
/// c = 2,
/// });
macro_rules! enum_serde_diesel {
($name:ident { $($variant:ident = $value:expr, )* }) => {
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord, FromSqlRow, AsExpression)]
#[sql_type = "::diesel::sql_types::SmallInt"]