Skip to content

Instantly share code, notes, and snippets.

@datygra
datygra / anchors-up.user.js
Created December 12, 2024 18:53 — forked from gibson042/anchors-up.user.js
Anchors Up user script
// ==UserScript==
// @name Anchors Up
// @namespace https://github.com/gibson042
// @description Navigates to in-page anchors upon {Command,Ctrl}+click or (with Shift) scrolls to arbitrary elements.
// @source https://gist.github.com/gibson042/73dfb17bfa7d35a9fb2e4c396365c321
// @updateURL https://gist.github.com/gibson042/73dfb17bfa7d35a9fb2e4c396365c321/raw/anchors-up.user.js
// @downloadURL https://gist.github.com/gibson042/73dfb17bfa7d35a9fb2e4c396365c321/raw/anchors-up.user.js
// @version 0.5.0
// @date 2023-09-08
// @author Richard Gibson <@gmail.com>
@datygra
datygra / appinfo.md
Created June 11, 2024 18:07 — forked from ttscoff/appinfo.md
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

@datygra
datygra / grab links.bookmarklet
Created May 5, 2023 18:59 — forked from ttscoff/grab links.bookmarklet
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@datygra
datygra / Defeat supercookie.js
Created October 15, 2022 23:38 — forked from lukepothier/Defeat supercookie.js
Tampermonkey script to prevent websites from tracking you using favicon fingerprinting
// ==UserScript==
// @name Defeat supercookie (https://github.com/jonasstrehle/supercookie)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Prevent websites from tracking you using favicon fingerprinting
// @author Luke Pothier <lukepothier@gmail.com>
// @match https://*/*
// @match http://*/*
// @grant none
// ==/UserScript==
@datygra
datygra / gist:7ac84db410343df349f35a817ac50d17
Created September 21, 2022 18:44 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@datygra
datygra / copy-element-text-bookmarklet.js
Created June 19, 2022 04:21 — forked from foobear/copy-element-text-bookmarklet.js
JavaScript bookmarklet to click an element and copy its text contents. See https://makandracards.com/makandra/46962
(function() {
var overlay = document.createElement('div');
Object.assign(overlay.style, {
position: 'fixed',
top: 0,
left: 0,
width: '100vw',
height: '100vh',
zIndex: 99999999,
background: 'transparent',
@datygra
datygra / bookmarks-to-notion.js
Created April 11, 2022 00:24 — forked from iamandrewluca/bookmarks-to-notion.js
Export browser bookmarks, import them in Notion as a database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
http://invisible-island.net/xterm/
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
@datygra
datygra / inject.js
Created December 13, 2021 16:53 — forked from nylen/inject.js
JavaScript file to allow injecting scripts into a page using GreaseMonkey/TamperMonkey and running a callback when loading is complete. Based on http://stackoverflow.com/questions/6725272/dynamic-cross-browser-script-loading .
function inject(src, callback) {
if (typeof callback != 'function') callback = function() { };
var el;
if (typeof src != 'function' && /\.css[^\.]*$/.test(src)) {
el = document.createElement('link');
el.type = 'text/css';
el.rel = 'stylesheet';
el.href = src;