Skip to content

Instantly share code, notes, and snippets.

@fwindpeak
fwindpeak / replace-author.py
Last active June 26, 2024 07:10
git change history author name and email
#!/bin/bash
git filter-repo --commit-callback '
if commit.author_name == b"name1" or commit.author_name == b"name1" or commit.author_email == b"[email protected]":
commit.author_name = b"fwindpeak"
commit.author_email = b"[email protected]"
' --force
@fwindpeak
fwindpeak / hover-light-card.html
Created March 6, 2024 06:04
Inspiration from coze.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hover Light Card</title>
</head>
<body class="flex-center">
@fwindpeak
fwindpeak / dukouCheckin.py
Created February 23, 2024 06:13
dukou auto checkin with crontab
#!/bin/env python3
#coding:utf-8
import requests
import json
from datetime import datetime
email="email"
passwd="passwd"
token = requests.post('https://dukou.io/api/token',json={"email":email,"passwd":passwd}).json()['token']
@fwindpeak
fwindpeak / xlsx-combine.js
Created February 16, 2023 08:29
Combine multiple xlsx files with consistent structure into one
const xlsx = require('xlsx');
const glob = require('glob');
let result = [];
const readXlsx = (filePath) => {
const wb = xlsx.readFile(filePath);
for (let sheetName of wb.SheetNames) {
@fwindpeak
fwindpeak / pwa_server.py
Created May 26, 2022 08:44
dynamic pwa icon server
from bottle import route, run, template, static_file, request
import os.path
dist_path = './dist'
pwa_file_name = 'pwa-upload.png'
@route('/hello/<name>')
def hello(name):
return template('<b>Hello {{name}}</b>!', name=name)
@fwindpeak
fwindpeak / markdown.css
Created April 24, 2022 03:37
simple markdown css
h1,
h2,
h3,
h4 {
color: #111111;
font-weight: 400;
}
h1,
h2,
h3,
@fwindpeak
fwindpeak / git-ignore-line.sh
Created February 10, 2022 07:18 — forked from aryelgois/git-ignore-line.sh
Git filter to ignore lines in your files
#!/bin/sh
# Git filter to ignore lines in your files.
#
# Copyright (c) 2017-2019 Aryel Mota Góis <[email protected]>
#
# MIT License
#
#
# SETUP:
#
@fwindpeak
fwindpeak / git_commit_aliases.sh
Last active March 6, 2024 06:07
git commit aliases for .bashrc
gitc(){
echo "git commit -m '$1: $2'"
git commit -m "$1: $2"
}
gfix(){
gitc fix "$*"
}
gfeat(){
@fwindpeak
fwindpeak / setNodeMirror.sh
Created November 24, 2021 03:15 — forked from hetykai/setNodeMirror.sh
修改node npm yarn的镜像源设置,替换为国内的淘宝源
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
@fwindpeak
fwindpeak / pointline.vue
Created March 5, 2021 08:40
vue pointline component with fabric.js
<template>
<canvas id="canvas"></canvas>
</template>
<script>
import { fabric } from 'fabric'
export default {
props: {
value: {
type: Array,