| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| import heapq | |
| import time | |
| import random | |
| import matplotlib.pyplot as plt | |
| def Randomlist(length): | |
| M = [random.random() for i in range(length)] | |
| return M | |
| def Median1(ListM1): |
简明 Python 教程: http://woodpecker.org.cn/abyteofpython_cn/chinese/
一开始通读一遍这个很不错,是最简单明确的 Python 教程,最适合快速了解。
####upgrade all apps(this will update ALL apps though they are the latest version)
sudo rm -rf "$(brew --cache)"
brew update
for app in $(brew cask list); do
brew cask install --force "${app}"
donesome tools such as arping, arp-scan may need to be installed by homebrew.
####ifconfig
ifconfigshows network interface information, such as interface name, tpye, IP address, Mac address, etc.
####host
host www.google.com
return domain's ip address.
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
| # | |
| # /etc/sysctl.conf - Configuration file for setting system variables | |
| # See /etc/sysctl.d/ for additonal system variables | |
| # See sysctl.conf (5) for information. | |
| # | |
| #kernel.domainname = example.com | |
| # Uncomment the following to stop low-level messages on console | |
| #kernel.printk = 3 4 1 3 |
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
| # Basically the nginx configuration I use at konklone.com. | |
| # I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
| # | |
| # To provide feedback, please tweet at @konklone or email eric@konklone.com. | |
| # Comments on gists don't notify the author. | |
| # | |
| # Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
| # Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
| server { |
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
| import logging | |
| log_path = '/tmp' | |
| log_name = 'log_example' | |
| logFormatter = logging.Formatter('%(asctime)s %(message)s') | |
| logger = logging.getLogger('log_example') | |
| logger.setLevel(logging.INFO) |
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
| import signal | |
| import functools | |
| # 定义一个Exception,后面超时抛出 | |
| class TimeoutError(Exception): | |
| pass | |
| def timeout(seconds, error_message='Function call timed out'): |
OlderNewer