Red Gregory

View Original

10 Text-Expander Snippets And Shortcuts I Use With Notion

Universal Snippets

1. Lowercase (Shell Script)

Turn all text in the clipboard to lowercase.

Shortcut: %lc

#!/usr/bin/perl -w

use strict;

my($text);

$text =`pbpaste`;

print "\L$text";

2. Plain Text (Shell Script)

Remove all formatting from text in the clipboard.

Shortcut: %wilk

#!/usr/bin/perl -w

use strict;

my($text);

$text =`pbpaste`;

print $text

3. Replace Whitespace (Shell Script)

Replace all whitespace from text in the clipboard with a dash.

Shortcut: \-pl

#!/usr/bin/perl -w

use strict;

my($text);

$text =`pbpaste | sed -e 's/ /-/g'`;

print $text

4. Random Number 1-100 (Javascript)

Return a random number between 1 and 100.

Shortcut: %dm

Math.floor(Math.random() * 100) + 1

Snippets With Notion

5. Red Superscript (Plain Text)

Return a superscript with red font.

Shortcut: \sp

\color{red}^{FILL-IN} POSITION CURSOR HERE

6. Google Maps (Plain Text)

Return an embed of a specific location with Google Maps.

Shortcut: \gb

https://www.google.com/maps/place/FILL-IN

How ‘Fill-In’ should be arranged: city,+country

7. Random Weekday (Javascript)

Return a random weekday from “Monday” to “Sunday.”

Shortcut: \day

var qList = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]

var qLength = qList.length

var qRandom = Math.floor((Math.random() * qLength));

qList[qRandom]

Various Symbols

8. Between (Plain Text)

Shortcut: ^bet

9. Change (Plain Text)

Shortcut: ^cha

10. Star Ratings

Returns star ratings in a list from 1-5 using optional selections.

Shortcut: ^rate