List of helpful shortcuts for faster coding
- GET Requests
- POST/PUT Requests
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import codecs, datetime, math, re | |
import pandas as pd | |
import numpy as np | |
from numpy import nan as NA | |
import matplotlib.pyplot as plt | |
from matplotlib.font_manager import FontProperties | |
COLNAMES = [u'用户ID',u'用户名',u'性别',u'生日',u'一推',u'二推',u'发帖',u'回复',u'注册时间',u'最后登陆时间',u'积分',u'通货'] |
This file contains hidden or 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
rabbitmqctl add_user someuser somepass | |
rabbitmqctl set_user_tags someuser administrator | |
rabbitmqctl set_permissions -p / someuser ".*" ".*" ".*" | |
Enable admin: | |
rabbitmq-plugins enable rabbitmq_management | |
rabbitmqadmin list queues |
- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
This file contains hidden or 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
"""Comparison of fetching web pages sequentially vs. asynchronously | |
Requirements: Python 3.5+, Requests, aiohttp, cchardet | |
For a walkthrough see this blog post: | |
http://mahugh.com/2017/05/23/http-requests-asyncio-aiohttp-vs-requests/ | |
""" | |
import asyncio | |
from timeit import default_timer |
This file contains hidden or 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
//HTML、CSS禁止选择文字,针对IE、FF、Chrome等 | |
<div unselectable="on" style="-moz-user-select:none;-webkit-user-select:none;" onselectstart="return false;"> | |
你选不了我, | |
unselectable: IE/Opera, | |
-moz-user-select: FireFox, | |
onselectstart: IE/Safari, | |
-webkit-user-select:Chrome | |
</div> |
This file contains hidden or 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
# Install tmux on Centos release 6.5 | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar -xvzf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure --prefix=/usr/local |
NewerOlder