Skip to content

Instantly share code, notes, and snippets.

View woshichuanqilz's full-sized avatar
😃
热爱生命

Ori woshichuanqilz

😃
热爱生命
View GitHub Profile
#!/usr/bin/python
import sqlite3
import shutil
from datetime import datetime, timedelta
import os
# Function to convert a Python datetime to Chrome timestamp format
def datetime_to_chrome_timestamp(dt):
chrome_epoch = datetime(1601, 1, 1)
return int((dt - chrome_epoch).total_seconds() * 1000000)
@woshichuanqilz
woshichuanqilz / getContent.py
Created July 2, 2024 21:54
get text content from html
import os
import re
from bs4 import BeautifulSoup
from multiprocessing import Pool
def extract_html_content(file_path):
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
soup = BeautifulSoup(content, 'html.parser')
main_content = soup.get_text()
function greet(message) {
console.log(`${message}, ${this.name}!`);
}
const person = {
name: 'John'
};
// 使用apply调用函数,并将person对象作为上下文,参数值作为数组传递
greet.apply(person, ['Hello']); // 输出:Hello, John!
// 创建一个人物对象
const person = {
name: 'John',
age: 30,
greet: function() {
console.log(`你好,我的名字是${this.name},我今年${this.age}岁。`);
}
};
// 创建一个带有绑定执行上下文的新函数
@woshichuanqilz
woshichuanqilz / hand-written-svg-text-animation.markdown
Created November 24, 2022 09:39
Hand written SVG text animation

Hand written SVG text animation

A little hand written text animation made with anime.js. The masking is a little rough but you get the idea :P.

A Pen by Matthew Ellis on CodePen.

License.