Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
sudo exit

David Blue extratone

🗿
sudo exit
View GitHub Profile
@kepano
kepano / obsidian-web-clipper.js
Last active April 6, 2025 19:24
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/" */
@IceBotYT
IceBotYT / elevation.scriptable.js
Created July 22, 2021 19:36
What is my Elevation Script
const debug = false;
let stop = false;
function getLocation() {
return new Promise((resp, reje) => {
Location.current().then(loc => {
resp(loc)
})
})
}
@ZeusOfTheCrows
ZeusOfTheCrows / Telegram Theming Reference.md
Last active June 14, 2024 15:53
Comprehensive reference description of telegram theming elements
@ttscoff
ttscoff / macosDND.m
Last active September 21, 2022 14:44
Objective-C code for toggling Do Not Disturb on macOS (including Big Sur)
/// Turn Do Not Disturb on or off
/// Only handles on and off, no schedules
/// @param enabled true on, false off
- (void)setDND:(BOOL)enabled {
NSLog(@"Turning Do Not Disturb %@", (enabled ? @"on" : @"off"));
if (@available(macOS 11.0, *)) {
NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.apple.ncprefs"];
NSData * subPlistData = [defaults objectForKey:@"dnd_prefs"];
NSMutableDictionary * propertyListDict = [[NSPropertyListSerialization propertyListWithData:subPlistData options:0 format:nil error:nil] mutableCopy];
@marcus-crane
marcus-crane / delete-firefox-devices.py
Created April 27, 2021 06:16
A python script for bulk deleting old devices
"""
Roughly based off https://gist.github.com/gbaman/b3137e18c739e0cf98539bf4ec4366ad
To grab your access token, log into https://accounts.firefox.com/settings
Open your browser dev tools (Right click -> Inspect Element), go to the Network tab
and refresh the page to populate the network stream.
Click on any one of the POST requests to https://graphql.accounts.firefox.com/graphql
and then under the Request Headers portion (at the bottom of the Headers tab),
copy the value for the Authorization Header. Just the token, not the Bearer text itself.
@mambru82
mambru82 / url-regex-tutorial.md
Created April 19, 2021 02:49
regex tutorial for URL matching

Matching a URL using regular expressions - a tutorial

The following gist gives a thorough description of the central components in matching a given URL utilizing regular expressions in Javascript.

Summary

Regex uses a sequence of characters to define a specific search pattern. In the URL matching regex, regex matches any valid URL.

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
@extratone
extratone / wgetarchive.md
Last active March 7, 2024 23:36
A single-line command for wget that *actually* builds an archive of a given domain.

Customized (For my use.)

wget -e robots=off -R mpg,mpeg,mp4,mov,wav,tgz,zip,flv --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains bilge.world --no-parent bilge.world
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains extratone.com --no-parent extratone.com
@cad0p
cad0p / Text Substitutions plist to csv.py
Created March 14, 2021 04:27
How to convert mac text substitutions from plist to csv for export to apps like text expander and atext
with open('./TextSubstitutions.plist', 'rb') as _plist:
with open('./TextSubstitutions.csv', 'w') as _csv:
plistfile = plistlib.load(_plist)
csvfile = csv.DictWriter(_csv, fieldnames=['shortcut', 'phrase'])
csvfile.writeheader()
for data in plistfile:
csvfile.writerow(data)
@njjerrysmith
njjerrysmith / mdTableGenerator.js
Last active January 17, 2022 22:44
TextExpander Javascript Markdown Table Generator
var rows = Number(%filltext:name=bodyrows:default=2:width=5%); //body of table rows
var cols = Number(%filltext:name=cols:default=4:width=5%); //columns of table
var rows = rows + 2; //add a rows to account for header and seperator
var text = ''; //variable to store the output
for (rCount = 1; rCount <= rows; rCount++) {
for (cCount = 1; cCount <= cols; cCount++) {
if (rCount == 1) { // Header Row Output
if (cCount == 1) {
text += '**%|** |';