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
def utc_to_shanghai(date: str): | |
""" | |
utc 转 shanghai 时区 | |
:param date: | |
:return: | |
""" | |
import time | |
import pytz | |
import datetime | |
timestamp = time.mktime(time.strptime(date, '%Y-%m-%dT%H:%M:%SZ')) |
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
#!/usr/bin/env node | |
'use strict'; | |
const puppeteer = require("puppeteer"); | |
(async () => { | |
let url = 'https://xxxx.com' | |
const browser = await puppeteer.launch({ | |
args: [ | |
'--start-maximized', | |
'--no-sandbox', |
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
//点击三次,选中状态,下次再输入就清空了 | |
await element.click({clickCount: 3}) | |
await element.type(INPUT_TEST_TEXT) |
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 -*- | |
try: | |
import urlparse | |
from urllib import urlencode | |
except: # For Python 3 | |
import urllib.parse as urlparse | |
from urllib.parse import urlencode | |
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 | |
import subprocess | |
def run_system_cmd(cmd): | |
""" | |
运行系统命令,并返回输出 | |
:param cmd: | |
:return: | |
""" | |
out, error = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).communicate() |
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
await page.on('dialog', dialog => { | |
dialog.dismiss() | |
}); |
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
https://github.com/JesusFreke/smalidea |
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
go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.io |
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
RUN apk update \ | |
&& apk add tzdata \ | |
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | |
&& echo "Asia/Shanghai" > /etc/timezone |
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
go to https://github.com/protocolbuffers/protobuf/releases/tag/xxxx # tag | |
unzip protobuf-python-3.18.0.zip | |
cd protobuf-3.18.0 | |
./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
make | |
sudo make install |
OlderNewer