Skip to content

Instantly share code, notes, and snippets.

View joyc's full-sized avatar
:octocat:
Data&Web

joyc joyc

:octocat:
Data&Web
View GitHub Profile
@joyc
joyc / blog_spider.py
Created December 13, 2022 16:34
thread pool demo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : blog_spider.py
# @Author : Hython
# @Date : AD 2022/12/14 0:19
import requests
from bs4 import BeautifulSoup
import concurrent.futures
@joyc
joyc / README.txt
Created October 3, 2022 04:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX DEFAULT WORKSPACE
Remix default workspace is present when:
i. Remix loads for the very first time
ii. A new workspace is created with 'Default' template
iii. There are no files existing in the File Explorer
This workspace contains 3 directories:
1. 'contracts': Holds three contracts with increasing levels of complexity.
@joyc
joyc / code.md
Created January 9, 2020 14:12 — forked from gopalindians/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI

@joyc
joyc / checkGmail.js
Last active June 10, 2019 08:01
use Google Apps Scripts to check gmail into Speadsheet
// Main処理
function checkMasterDeDiff() {
var query = getQueryStr();
var deNoMail = 'de_recovery_thanks_automation_no_mail';
var deNoMailNum = getCountNum(query, deNoMail);
var deNoMailRec = 'de_recovery_thanks_automation_no_mail_rec';
var deNoMailRecNum = getCountNum(query, deNoMailRec);
var deNoCar = 'de_recovery_thanks_automation_no_car';
import sys
import re
import shutil
import json
# str_url = 'test,&nbsp;url("http://www.baidu.com")&,dddddd "="" <svg></svg><path></path><img src="http://www.baidu.com">ininnnin<img src="http://www.dd.com">'
# # 2、把代码中的["=""]去掉;
# # 3、把[svg]和[path]标签都改为[svg:svg]和[svg:path];
# str_url = str_url.replace('"=""', '')
# str_url = str_url.replace('svg', 'svg:svg')
@joyc
joyc / Tutorial_note.md
Last active November 20, 2018 07:46
Note Of Python Tutorial #memo #note

Tutorial Note

1

设置系统变量: set path=%path%;C:\python36

5 Data Structures

5.1.4

@joyc
joyc / diffexcelfile.py
Created October 31, 2018 07:28
diff excel file #excel #pandas
# create 2018.10.20
import pandas as pd
from pathlib import Path
def excel_diff(path_OLD, path_NEW):
df_OLD = pd.read_excel(path_OLD).fillna('null')
df_NEW = pd.read_excel(path_NEW).fillna('null')
@joyc
joyc / flexibleSearch.impex
Created October 31, 2018 07:27
hybris #hybris #impex #flexiblequery
select {p.pk},{category.code}
from { Product as p join CatalogVersion as cv on {p.catalogversion}={cv.pk} join Category as category on {cv.category}={category.pk} }
where {cv.version}='Staged'
and {category.code}='luCeramicCapacitorsSMD'
select {category.code} from { CatalogVersion as cv join Category as category on {cv.category}={category.pk} } where {} in ('luCeramicCapacitorsSMD')
and {catalog.id} in ('','','','','')
where {cv.version}='Staged'
@joyc
joyc / loadtimetest.py
Last active June 12, 2024 09:14
page load time test
"""
Measure Page Loading Time by Selenium & ChromeDriver 0.2
Performance Timing Events flow
navigationStart -> redirectStart -> redirectEnd -> fetchStart -> domainLookupStart -> domainLookupEnd
-> connectStart -> connectEnd -> requestStart -> responseStart -> responseEnd
-> domLoading -> domInteractive -> domContentLoaded -> domComplete -> loadEventStart -> loadEventEnd
by: chuang.li
"""
from time import sleep
import threading
@joyc
joyc / pymemo.md
Last active December 17, 2018 08:54
python memo
  1. windows pip update all packages 升级所有包
1. powershell
pip3 list --outdated --format=legacy | ForEach { pip3 install -U $_.split(" ")[0] }
2. cmd
for /F "delims= " %i in ('pip list --outdated --format=legacy') do pip install -U %i
3. pyshell
import os
import pip
from subprocess import call, check_call