Skip to content

Instantly share code, notes, and snippets.

Yue Chen caimaoy

Block or report user

Report or block caimaoy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View asyncio-as-complete.py
async def main():
coroutine1 = do_some_work(1)
coroutine2 = do_some_work(2)
coroutine3 = do_some_work(4)
tasks = [
asyncio.ensure_future(coroutine1),
asyncio.ensure_future(coroutine2),
asyncio.ensure_future(coroutine3)
]
@jorben
jorben / openssl_tool.txt
Last active Aug 6, 2018
RSA加解密,签名、验签文件
View openssl_tool.txt
1) Generate RSA key:
$ openssl genrsa -out key.pem 1024
$ openssl rsa -in key.pem -text -noout
2) Save public key in pub.pem file:
$ openssl rsa -in key.pem -pubout -out pub.pem
$ openssl rsa -in pub.pem -pubin -text -noout
3) Encrypt some data:
@Integralist
Integralist / Python Asyncio Timing Decorator.py
Last active Nov 8, 2019
Python Asyncio Timing Decorator
View Python Asyncio Timing Decorator.py
import asyncio
import time
def timeit(func):
async def process(func, *args, **params):
if asyncio.iscoroutinefunction(func):
print('this function is a coroutine: {}'.format(func.__name__))
return await func(*args, **params)
else:
@justinbellamy
justinbellamy / cltools.sh
Last active Jun 27, 2019 — forked from jellybeansoup/cltools.sh
Install Autoconf and Automake on OS X El Capitan
View cltools.sh
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@lucifr
lucifr / gist:1208100
Created Sep 10, 2011
Sublime Text 2 - 实用快捷键 (Mac OS X)
View gist:1208100
You can’t perform that action at this time.