Skip to content

Instantly share code, notes, and snippets.

View onewesong's full-sized avatar
🎯
Focusing

onewesong

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
# coding: utf-8
import cson
def read_file(fp):
with open(fp) as f:
return f.read()
@onewesong
onewesong / web_timing.py
Created March 24, 2022 09:47 — forked from mkaz/web_timing.py
Use Selenium to Measure Web Timing
#!/usr/bin/env python
"""
Use Selenium to Measure Web Timing
Performance Timing Events flow
navigationStart -> redirectStart -> redirectEnd -> fetchStart -> domainLookupStart -> domainLookupEnd
-> connectStart -> connectEnd -> requestStart -> responseStart -> responseEnd
-> domLoading -> domInteractive -> domContentLoaded -> domComplete -> loadEventStart -> loadEventEnd
@onewesong
onewesong / mysql_cheat_sheet.md
Created September 15, 2020 05:01 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@onewesong
onewesong / asyncio.py
Created March 26, 2021 03:13 — forked from FBosler/asyncio.py
ThreadPool
from datetime import datetime
import aiohttp
import asyncio
URL = "https://medium.fabianbosler.de/run"
async def sample_asyncio(samples):
start = datetime.now()
@onewesong
onewesong / pandas大法.md
Last active September 15, 2020 06:32
jupyter_cheat_sheet

pandas 常用

  • 直接拷贝表格传入notebook
pd.read_clipboard()
  • 读取xls文件转成csv文件
pd.ExcelFile(xls_fpath).parse().to_csv(csv_fpath)
#