using Byte = std::uint8_t;
#include <vector>
#!/bin/bash | |
# Usage: copy the code into .zshrc config file | |
# Find out current screen width and hight | |
_COLUMNS=$(tput cols) | |
# Set default message if ( input not provided | |
_MESSAGE=" FBI Warining " | |
# Calculate x and y coordinates so that we can display $MESSAGE | |
# centered in the screen | |
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 )) | |
spaces=$(printf "%-${y}s" " ") |
# coding: utf-8 | |
import types | |
class Task(object): | |
taskid = 0 | |
def __init__(self, target): | |
Task.taskid += 1 | |
self.tid = Task.taskid |
package main | |
import ( | |
"bufio" | |
"log" | |
"net/rpc" | |
"os" | |
) | |
func main() { |
#!/usr/bin/env python | |
# coding: utf8 | |
import os | |
import sys | |
import calendar | |
import datetime | |
# 函数运行时间测试装饰器 | |
import time | |
from functools import wraps |
#coding:utf-8 | |
import subprocess | |
import time | |
from fabric.api import settings, run, env | |
def wait_process_end(process, timeout): | |
if timeout <= 0: | |
process.wait() | |
return 0 |
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
# @Author: asyncliu | |
# @Date: 2017-08-12 10:32:58 | |
# @Last Modified by: asyncliu | |
# @Last Modified time: 2017-10-20 17:40:41 | |
# @Project: 日志工具类 | |
import logging, sys | |
import logging.handlers |
#!/usr/bin/env bash | |
# | |
# Auto install latest kernel for TCP BBR | |
# | |
# System Required: CentOS 6+, Debian7+, Ubuntu12+ | |
# | |
# Copyright (C) 2016-2017 Teddysun <i@teddysun.com> | |
# | |
# URL: https://teddysun.com/489.html | |
# |
// sublime for mac settings | |
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Colorsublime - Themes/Cozy.tmTheme", | |
"create_window_at_startup": false, | |
"default_line_ending": "unix", | |
"ensure_newline_at_eof_on_save": true, | |
"font_face": "monaco", | |
"font_size": 16, |