Skip to content

Instantly share code, notes, and snippets.

View willsheppard's full-sized avatar

Will Sheppard willsheppard

View GitHub Profile
@willsheppard
willsheppard / joplin_help.log
Created August 24, 2024 13:28
Joplin help log
This shows that Joplin doesn't make it easy enough to set up sync the first time, doesn't provide enough signposts, and is very slow.
```
root@localhost:~# joplin help
(node:4786) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Type `help [command]` for more information about a command; or type `help all` for the complete usage information.
The possible commands are:
@willsheppard
willsheppard / node_func_tut.md
Last active June 7, 2024 10:05
Node arrow functions tutorial

Basic function

function buildTower(height) {
  return "Built a tower " + height + " blocks high";
}

Basic arrow function

@willsheppard
willsheppard / pinboard-bookmarklet.js
Created January 17, 2024 16:15 — forked from jsit/pinboard-bookmarklet.js
Pinboard Bookmarklet -- Use text selection for description if available, otherwise use meta description, and include referrer in description if exists.
javascript: q = location.href;
q = q.replace(/[?&]utm_[^&]*/g, "");
q = q.replace(/[?&]mc_[^&]*/g, "");
q = q.replace(/[?&]src=[^&]*/g, "");
q = q.replace(/[?&]ref=[^&]*/g, "");
desc = "";
if (document.getElementsByName("description").length > 0) {
desc = document.getElementsByName("description")[0].getAttribute("content")
"\n\n"
} else if (document.getElementsByName("Description").length > 0) {
@willsheppard
willsheppard / sudoers_cheat_sheet.md
Last active October 9, 2023 08:18
Sudoers cheat sheet

Define text editor

$ sudo update-alternatives --config editor

Edit /etc/sudoers file

$ sudo visudo /etc/sudoers
@willsheppard
willsheppard / google-meet-helper.user.js
Last active October 4, 2023 10:20
Google Meet Helper: auto camera off, auto mute, and auto-join
// ==UserScript==
// @name Google Meet helper
// @namespace Violentmonkey Scripts
// @match https://meet.google.com/*
// @grant none
// @version 1.3.04
// @author Vanshaj Girotra, Will Sheppard
// @description auto camera off, auto-mute, and auto join -- in that order. Also switches account (defaults to primary)
// @run-at document-idle
// ==/UserScript==
@willsheppard
willsheppard / elasticsearch.pl
Created September 29, 2023 10:30
ElasticSearch example query
use strict;
use warnings;
use Data::Dumper::Concise;
use Search::Elasticsearch;
my $ekk = Search::Elasticsearch->new(
client => '7_0::Direct',
nodes => [ 'https://opensearch.example.com/', ],
send_get_body_as => 'POST',
@willsheppard
willsheppard / atlassian_redirect.user.js
Last active September 13, 2023 10:36
Atlassian Confluence wiki and Jira redirect
// ==UserScript==
// @name AtlassianRedirect
// @namespace atlassian.com
// @version 0.09
// @grant none
// @run-at document-end
// @match *://*.atlassian.com/*
// @match *://*.atlassian.net/*
// @author Ludo Tolhurst-Cleaver, Will Sheppard, Dan Banks
// ==/UserScript==
@willsheppard
willsheppard / test2_cheat_sheet.md
Last active September 20, 2023 11:28
Test2 cheat sheet for Perl
@willsheppard
willsheppard / ms_ssi.js
Created May 26, 2023 08:53 — forked from emlyn/ms_ssi.js
I keep getting shown the "Stay signed in" page on Microsoft domains, even when I select "don't show this again" - this script will automatically click on "yes" for you every time the page comes up.
// ==UserScript==
// @name Stay signed in to MS
// @description Automatically click "yes" on the Microsoft "stay signed in" page that keeps appearing.
// @downloadURL https://gist.github.com/emlyn/2f0c9702bd83fe7d232ed58626c90ac7/raw/ms_ssi.js
// @updateURL https://gist.github.com/emlyn/2f0c9702bd83fe7d232ed58626c90ac7/raw/ms_ssi.js
// @namespace https://gist.github.com/emlyn/
// @version 0.2
// @author Emlyn Corrin
// @match https://login.microsoftonline.com/login.srf
// @icon https://c.s-microsoft.com/favicon.ico?v2
@willsheppard
willsheppard / sqlite.md
Created April 5, 2023 16:00
SQLite basics

Command line example:

$ sqlite3 -line -cmd 'select * from zip limit 1' database.sqdb < `which echo` ".exit"> output