Skip to content

Instantly share code, notes, and snippets.

@lockcp
lockcp / readme.md
Created December 23, 2023 06:38 — forked from firexcy/readme.md
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
#/bin/bash
# Ubuntu20 桌面环境配置(arm兼容)
# 2021 flyqie
# 遇到错误马上退出,避免出现其他问题
set -e
# ...
set -x
# Xrdp
@lockcp
lockcp / tabsoutlinerdupes.js
Created July 30, 2022 19:10 — forked from Luckz/tabsoutlinerdupes.js
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);
@lockcp
lockcp / Sudoku.shell
Created May 15, 2022 09:53 — forked from JimmyLv/Sudoku.shell
roam/templates Sudoku
- General Sudoku [[九宫格]]
- [学习课题 + 应用场景 + 截止日期] #.jiugong
- {{[[kanban]]}}
- ↖
-
-
-
- ↑
-
-
;(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) {
@lockcp
lockcp / README.md
Created January 15, 2022 17:34 — forked from shodty/README.md
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```
@lockcp
lockcp / workflowy-with-image.js
Created December 11, 2021 17:09 — forked from Wizmann/workflowy-with-image.js
workflowy-with-image.js
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://workflowy.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@lockcp
lockcp / SteamFreeGamesFetcher.js
Created September 16, 2021 15:55 — forked from huiyadanli/SteamFreeGamesFetcher.js
Steam 免费游戏一键领取
/**
* Steam 免费游戏一键领取
* ------------------------
* 1.打开 https://store.steampowered.com/account/licenses/
* 2.登录网页steam账号
* 3.F12执行以下代码
*/
(function()
{
if( location.href.match( /^https:\/\/store\.steampowered\.com\/account\/licenses\/?$/ ) === null )
@lockcp
lockcp / Pinboard.scpt
Created August 25, 2021 19:27 — forked from itst/Pinboard.scpt
Import and update your Pinboard bookmarks to DEVONthink
(* Import and update your Pinboard bookmarks to DEVONthink
Based on work done by Christian Grunenberg on Mon Jan 23 2006,
Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010 and
Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished.
By Sascha A. Carlin <https://sascha.carlin.de/> on 2018-03-07 to set the creation date of new record, show progress bar, use Pinboard Auth Token, use modification date of folder to fetch only recent items
Copyright (c) 2018. All rights reserved. *)
use framework "Foundation"
@lockcp
lockcp / obsidian-web-clipper.js
Created August 11, 2021 17:00 — forked from kepano/obsidian-web-clipper.js
Obsidian Bookmarklet to clip pages
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/" */