Skip to content

Instantly share code, notes, and snippets.

View tianheg's full-sized avatar
🎯
Focusing

tianheg

🎯
Focusing
  • 14:21 (UTC +08:00)
View GitHub Profile
@tianheg
tianheg / weread.js
Created June 5, 2024 02:47
Weread Copy TOC button
// ==UserScript==
// @name 微信阅读复制目录
// @description 微信阅读复制目录
// @match https://weread.qq.com/web/reader/*
// @grant GM_setClipboard
// @version 1.0
// @require https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// ==/UserScript==
/* global $ */
@tianheg
tianheg / 📊 Weekly development breakdown
Last active June 19, 2024 00:12
📊 Weekly development breakdown
JSON 8 mins ██████▌░░░░░░░░░░░░░░ 31.4%
Astro 5 mins ████▊░░░░░░░░░░░░░░░░ 23.2%
Other 5 mins ████▌░░░░░░░░░░░░░░░░ 21.6%
Markdown 3 mins ██▊░░░░░░░░░░░░░░░░░░ 13.5%
Swift 1 min █▏░░░░░░░░░░░░░░░░░░░ 5.7%
@tianheg
tianheg / DOM3D.js
Created March 28, 2024 14:09 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@tianheg
tianheg / copy-memo.js
Last active May 11, 2024 14:08
Add a 'Copy' button to flomo each memo
// ==UserScript==
// @name Copy Memo Content
// @version 0.2
// @description Adds a copy button to each memo block to copy its content
// @source https://gist.github.com/tianheg/4d860adc121936524adbd42af547aff3
// @match https://m.tianheg.org/*
// ==/UserScript==
(function() {
'use strict';
@tianheg
tianheg / git-auto-status.plugin.zsh
Created March 9, 2024 04:01 — forked from oshybystyi/git-auto-status.plugin.zsh
OhMyZsh plugin to display git status after a bunch of predefined git commands
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
@tianheg
tianheg / weread.js
Created October 31, 2023 01:36
微信阅读复制目录
// ==UserScript==
// @name 微信阅读复制目录
// @description 微信阅读复制目录
// @match https://weread.qq.com/web/reader/*
// @grant GM_setClipboard
// @version 1.0
// @require https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// ==/UserScript==
/* global $ */
javascript: (() => {
const requestURL = 'https://gh.tianheg.xyz/readingList/save';
const token = ''; // Personal Access Token
const pageTitle = document.title;
const pageURL = window.location.href;
let metaImage = '';
let metaDescription = '';
function getMetaValue(propName) {