Skip to content

Instantly share code, notes, and snippets.

@ehsansabet
ehsansabet / README.md
Last active February 26, 2025 23:30
Add Event to Google Calendar
@thingsiplay
thingsiplay / woman
Last active June 8, 2023 04:22
woman - Preview list for man documents
#!/bin/env bash
# Lookup section meaning in `man man`.
sections='1,8,6,5,7'
show_manual () {
man -- "${1%% *}" 2> /dev/null
}
export -f show_manual
@piyush01123
piyush01123 / generatePassword.js
Last active March 21, 2023 23:14
Generate and copy to clipboard strong password - Tampermonkey script
// ==UserScript==
// @name Generate Strong Password
// @namespace http://tampermonkey.net/
// @version 3.1.1
// @description Strong password generator of size 12
// @author Piyush Singh
// @match *://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant unsafeWindow
// @grant GM_setClipboard
@evanreichard
evanreichard / darkreader.user.js
Last active September 10, 2024 14:52 — forked from kfur/darkreader.js
Dark Reader UserScript for Safari Browser
// ==UserScript==
// @name DarkReader
// @version 0.0.7
// @match *://*/*
// @downloadURL https://gist.github.com/evanreichard/f983ca26836d4af6ca0f6fb602b9dcaf/raw/darkreader.user.js
// @require https://unpkg.com/[email protected]/darkreader.js
// @grant GM.xmlhttpRequest
// @grant GM.registerMenuCommand
// @grant GM.unregisterMenuCommand
// @grant GM_getValue
@kepano
kepano / obsidian-web-clipper.js
Last active April 21, 2025 06:17
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/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@jeb5
jeb5 / Youtube Subs to OPML.js
Last active November 9, 2024 02:13
Youtube Subscriptions to RSS/OPML
const channels = [...document.querySelectorAll("#main-link.channel-link")].map(e => {
const [, a, b] = e.href.match("/((?:user)|(?:channel))/(.*)$");
const feed = "https://www.youtube.com/feeds/videos.xml?" + (a === "user" ? "user=" : "channel_id=") + b;
const channelName = e.querySelector("yt-formatted-string.ytd-channel-name").innerText;
return [feed, channelName];
});
if (channels.length == 0) {
alert("Couldn't find any subscriptions");
} else {
console.log(channels.map(([feed, _]) => feed).join("\n"));
@HemanthJabalpuri
HemanthJabalpuri / README.md
Created October 25, 2020 08:52
My settings config for Multiling O Keyboard

INSTALLATION

  1. copy contents of multilingHemanth.txt. (text encoding: UTF-8)
  2. open Multiling Keyboard settings > Misc. > Import | Export > Settings. click on Paste.
@atnbueno
atnbueno / click-to-delete.user.js
Last active August 22, 2023 04:29
A userscript to delete page elements when clicked twice while pressing Alt, Control, and Shift simultaneously
// ==UserScript==
// @name Click to delete
// @author Antonio Bueno
// @namespace userscripts.atnbueno.com
// @description This script deletes page elements if clicked twice while simultaneously pressing Alt, Control, and Shift
// @version 2.0
// @grant none
// ==/UserScript==
/*
@moqmar
moqmar / .bashrc
Last active June 15, 2024 09:04
My tiny & awesome .bashrc
###################################################################################################
# This is a very simple .bashrc file that I'm using on a daily basis. #
# It completely replaced my zsh setup, and should be relatively simple to understand and modify. #
# #
# Built by Moritz (mo-mar.de) - just do whatever you want with it, according to the Unlicense: #
# https://choosealicense.com/licenses/unlicense/ #
# #
# Simple installation: #
# wget https://go.momar.de/bashrc -O ~/.bashrc #
###################################################################################################