Skip to content

Instantly share code, notes, and snippets.

@ImSingee
ImSingee / audit.yml
Created November 15, 2023 12:36 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@ImSingee
ImSingee / viewtree.py
Created October 19, 2023 03:04 — forked from avielg/viewtree.py
SwiftUI View Tree Graph
#!/opt/homebrew/bin/python3
import re
import glob
import os
import graphviz
##################################################################################
######### USAGE #########
@ImSingee
ImSingee / go-embed-data-and-gen-new.go
Created April 24, 2023 12:24
Embed data in a Go program and generate new executable (just a demo, not optimized for production)
package main
import (
"bytes"
"fmt"
"io"
"os"
)
const flagStart = `-----{% start %}-----`
@ImSingee
ImSingee / raindrop_clear.py
Last active April 19, 2023 08:04
Clear large Raindrop collections via API
collection_id = '...' # -99 to empty trash
token = '...'
from requests import Session
session = Session()
session.headers = {
'Authorization': f'Bearer {token}'
}
@ImSingee
ImSingee / KM_LeetCode_ID.py
Last active August 11, 2022 05:57
LeetCode id -> title slug
#!/opt/bin/python3
import os
import requests
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers').strip()
cookies={
"LEETCODE_SESSION": ''
}
#!/opt/bin/python3
# pip install markdownify
import os
import requests
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers').strip()
cookies={
#!/opt/bin/python3
# pip install markdownify
import os
import requests
import markdownify
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers')
div[placeholder~="Heading"]::after {
margin-left: 0.5em;
font-size: 0.6em;
vertical-align: middle;
opacity: 0.7;
}
div[placeholder="Heading 1"]::after {
content: "h1";
}
@ImSingee
ImSingee / build-all.sh
Created November 11, 2020 02:24
Go 程序编译脚本,在编译过程中自动加入 Git Tag、Git Commit ID、利用 Git Tag 提取出来的版本信息、编译环境信息、编译时间
#!/bin/bash
set -e
echo Build All
echo Build for linux
(CGO_ENABLED=0 GOOS=linux ./build.sh)
echo Build for windows
(CGO_ENABLED=0 GOOS=windows ./build.sh)
"""
Example:
Input: {
"format": "short",
"label": "Mbps",
"logBase": 1,
"max": null,
"min": null,
"show": true