This file contains 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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
This file contains 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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
This file contains 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
from flask import Flask, request, jsonify, json, abort | |
from flask_cors import CORS, cross_origin | |
import pandas as pd | |
app = Flask(__name__) | |
cors = CORS(app) | |
app.config['CORS_HEADERS'] = 'Content-Type' |
This file contains 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
class MySQLCursor: | |
"""创建一个游标类""" | |
def __init__(self,cursor,logger): | |
self.cursor=cursor | |
self.logger=logger | |
def execute(self,sql,params=None): | |
self.logger.info(sql+str(params)) | |
self.cursor.execute(sql, params) |
This file contains 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
# author: the5fire.com | |
import re | |
import socket | |
from collections import namedtuple | |
RE_URL = re.compile(r'http://(.*)') | |
RE_CONTENT_LENGTH = re.compile(b'.*Content-Length: (\d+)') | |
EOF = '\r\n\r\n' | |
Response = namedtuple('Response', ['header', 'body']) |
This file contains 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 asyncio | |
async def _async_ping(ip): | |
"""发送ping包 | |
探测策略:发送3次包,每次间隔0.5s, 超时时间为2s | |
判断依据:指令执行的退出状态码是否正常为0 | |
Args: | |
ip (string): IP |
This file contains 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
####### GOLANG VERSION MANAGE FUNCTIONS ###### | |
# ref: https://go.dev/doc/manage-install | |
function goinstall() { | |
echo "Downloading go$1 ..." | |
go install golang.org/dl/go$1@latest && go$1 download | |
} | |
function gouse() { | |
gopath=$(go env GOPATH) | |
if test -x ${gopath}/bin/go$1; then |