Skip to content

Instantly share code, notes, and snippets.

@xubai2001
xubai2001 / BigModelTranslator.js
Last active October 26, 2025 11:26
xubai的仓输入法脚本
// author: 叙白
// date: 2025-07-30
// name: BigModelTranslator.js
// 注意:请在脚本中的变量功能中添加 bigmodel_key 变量,值为 BigModel 的 API Key
// 使用glm-4.5-airx ,可替换为glm-4.5-flash 免费模型,默认关闭思考
const BASE_URL = "https://open.bigmodel.cn/api/paas/v4/chat/completions";
const DEFAULT_MODEL = "glm-4.5-airx";
const DEFAULT_TEMPERATURE = 0.8;
@firexcy
firexcy / readme.md
Last active July 26, 2025 06:41
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@JimmyLv
JimmyLv / Sudoku.shell
Last active April 8, 2023 15:58
roam/templates Sudoku
- General Sudoku [[九宫格]]
- [学习课题 + 应用场景 + 截止日期] #.jiugong
- {{[[kanban]]}}
- ↖
-
-
-
- ↑
-
-
@Luckz
Luckz / tabsoutlinerdupes.js
Created September 20, 2021 11:11
Tabs Outliner: kill duplicate windows
// ctrl - shift - J on Tabs Outliner to open dev tools,
// then Sources -> Snippets -> New Snippet.
// Rightclick -> Run to execute.
// cyrb53 stolen from https://stackoverflow.com/a/52171480
const cyrb53 = function(str, seed = 0) {
let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
for (let i = 0, ch; i < str.length; i++) {
ch = str.charCodeAt(i);
h1 = Math.imul(h1 ^ ch, 2654435761);
@kepano
kepano / obsidian-web-clipper.js
Last active October 27, 2025 04:27
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
#/bin/bash
# Ubuntu20 桌面环境配置(arm兼容)
# 2021 flyqie
# 遇到错误马上退出,避免出现其他问题
set -e
# ...
set -x
# Xrdp
@samuelkordik
samuelkordik / readinglist_pinboard.py
Last active February 16, 2023 07:23
Sync Safari Reading List bookmarks to Pinboard
#!/Users/samuelkordik/.pyenv/shims/python
# ReadingListCatcher
# - A script for exporting Safari Reading List items to Markdown and Pinboard
# Originally by Brett Terpstra 2015, <https://brettterpstra.com/2015/01/06/reading-list-catcher/>
# Modifications by Zach Fine made in 2020 to use the original reading list item in the
# posts to pinboard.
# Updated 2021-06-21 by Samuel Kordik to fix errors due to deprecated API in plistlib,
# changes to Pinboard api and Pinboard python lib; added enhanced logging output
# and error handling to work as a cron job or shell script.
# Uses code from <https://gist.github.com/robmathers/5995026>
@chaomai
chaomai / check_time_and_mv.sh
Created November 12, 2020 03:05
check google takeout images, set a time for those without timestamp, and move them to destination directory
#!/usr/bin/env bash
function set_ts() {
local f=$1
dto=$($GNUBIN_COREUTILS/date -d "$dir_t" "+%Y:%m:%d 00:00:00")
echo exiftool -datetimeoriginal="$dto" "$f"
exiftool -datetimeoriginal="$dto" "$f"
local dest_path=$dest_dir/$dir_d
@shodty
shodty / README.md
Last active January 15, 2022 17:34
Create a Toggle button for the right sidebar in Roam.

Move the right sidebar toggle to a button in the upper right icon tray.

Demo

You can add this to Roam using {{[[roam/js]]}}

Grab the code in roam-sidebar-toggle.js and drop it in a javascript code block, nested underneath a {{[[roam/js]]}} block:

  ```javascript```
;(function () {
// Don't show navigation controls on mobile
var initialize_back_forward_buttons = () => {
// Don't show navigation controls on mobile
if(/Android|iPhone/i.test(navigator.userAgent)){
return;
}
if(window.initialized_back_forward_buttons) {