Skip to content

Instantly share code, notes, and snippets.

View sylumer's full-sized avatar

Stephen Millard sylumer

View GitHub Profile
@sylumer
sylumer / lorem-para-300.md
Created May 13, 2023 08:04
300 Paragraphs of Lorm Ipsum Test

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec condimentum ante nec erat tempor congue. In hac habitasse platea dictumst. Mauris mi magna, tempus non tristique non, pretium vel risus. Proin a nulla imperdiet, scelerisque nunc sit amet, aliquam sem. Sed commodo efficitur odio, eget condimentum dui scelerisque vel. Curabitur feugiat cursus mi a viverra. Integer in libero et erat aliquam ornare. Sed at orci tincidunt quam tincidunt efficitur ut nec diam. Aliquam erat volutpat. Donec maximus fringilla feugiat.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porttitor dui venenatis commodo gravida. Fusce ut faucibus mauris. Integer sit amet tempor mi. Aliquam cursus urna et mi imperdiet vulputate vel quis enim. In blandit magna felis, non facilisis ex egestas quis. Nunc aliquam lorem eu pulvinar hendrerit. Praesent varius eros orci, eu vulputate justo dapibus ut.

**Sed nunc elit, egestas et volutpat vel, finibus id neque. Fusce vestibulum sit amet risus nec mattis. Nul

@sylumer
sylumer / control.json
Last active April 23, 2024 22:34
Demo JSON for a Shortcut Control
{
"first_action" :
{
"name" : "Say Hello",
"version" : "2",
"install_url": "https://www.icloud.com/shortcuts/a1f7d39b7b1a4a8b982478457ce1d8fb"
},
"last_action" :
{
"name" : "Say Bonjour",
@sylumer
sylumer / daily-timeline.html
Last active April 23, 2024 22:33
Obsidian Annual Timeline
<html>
<body>
<script>
function isLeapYear(p_intYear)
{
return (p_intYear % 100 === 0) ? (p_intYear % 400 === 0) : (p_intYear % 4 === 0);
}
function writeYear(p_intYear)
@sylumer
sylumer / makeMonthFolders.bat
Created January 12, 2023 17:55
DOS Batch Script: Create Month Folders - Format "DD"
@ECHO OFF
REM Create a set of folders 01 to 12 in the current directory
FOR /L %%i IN (1,1,12) DO (
IF %%i% LSS 10 (
MKDIR "0%%i%"
) ELSE (
MKDIR "%%i%"
)
)
@sylumer
sylumer / shortcuts_from_drafts.js
Created December 31, 2022 19:25
Functions for calling Shortcuts on the Mac via a shell command
// Run a shortcut and return the result
function shortcutRun(p_strShortcutName, p_strShortcutInput)
{
// Define the script to run
let objShell = ShellScript.create(`#!/bin/zsh
echo "${p_strShortcutInput}" | shortcuts run "${p_strShortcutName}" | tee`);
// Run the script and return the result or write out any error to the log.
if (objShell.execute()) return objShell.standardOutput;
else
@sylumer
sylumer / scrollfix.bat
Created October 6, 2022 09:04
Script to run on Windows when the scroll wheel on a Logitech mouse stops working in Chrome, etc.
@ECHO off
REM Kill the rogue Logitech Options Manager process
TASKKILL /f /t /im "LogiOptionsMgr.exe"
REM Force a wait (*ignore key presses*)
TIMEOUT /t 2 /nobreak
REM Restart the Logitech Options Manager
START "Logitech Options Manager" /D "C:\ProgramData\Logishrd\LogiOptions\Software\Current\" "LogiOptionsMgr.exe"
@sylumer
sylumer / gist:d5a7fd4c3dc9fef30a4491df86532fb7
Created March 10, 2022 20:03
TextExpander JavaScript Snippet for Last Day of Previous Month
let dtNow = new Date();
let dtLastDayOfPrevMonth = new Date(dtNow.getFullYear(), dtNow.getMonth(), 0);
let fmtDate = new Intl.DateTimeFormat('en-us',
{
month: "long",
day: "numeric",
year: "numeric"
});
//Output the formatted date (e.g. "February 28, 2022")
@sylumer
sylumer / code.js
Created March 2, 2021 21:01
TextExpander Cross-Platform UUID (v4) Code - JavaScript
function uuidv4(a,b)
{
for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');
return b;
}
TextExpander.appendOutput(uuidv4());
@sylumer
sylumer / MP3_Audio_Example_B64.txt
Created August 3, 2020 19:06
Example Base64 MP3 File
SUQzAwAAAAAAPVRFTkMAAAAIAAAARmlzc2lvblRTU0UAAAASAAAAR2FyYWdlQmFuZCAxMC4zLjVUTEVOAAAABQAAADE1Njf/+1JAgYAATgM3g2wQAgnAZvBtggBA2AreDSQgCBsBW8GkhAEJnDii4g/ygnCZiaTLkQAABksgmRTWczvZ0c1nGOcfKvBrRWGhAUcPrZ146GCwyXfMemsziTQMKjDAyMgDoMHDeAkoQdBg4EUNLtuvK3Ihyhi7KH9YnBEggtB9iaX7N4BBI081SMTVPDTcSy6l8Ny/Ok32k5XhuH+1KGLtIhzHKURi3goIvBOT/Rl3+XeIAIQgGBAYCAAMfHgCR3AyldgNABYDV62A5whARE0BQf/7UkDHgAGoD7iDGGEyMqF3EGMMJhBclxdV3IACFxKi9rmAAKA1CoGFgSAExwMKgQZQbgIggTwNrg3eF/Loc0PQBigvGBugTx7EwXx8UgaLckSakbEmbOks5UyBhSpmJ1mQTN3dNJqj1TIpLpmiCGmiirVQu/WpBBDspJNbenX+601p/Tur/U///////////////////////4AICQcVU+/////H//HA4RHhwCZAoeNJh5OPGEUohjMRqnmd34tXQhnavMjmaVrvf9xn+b/tdKbf//tSYGWABJmQTp5VoABQEgrtw4gABqRFUV2jAAh2hqx3kjAA/rv/////////////////////////////gAAG7v//w+z4CegwJdO4OIo8Ns6VKjRyQ0+3+5oqUR2dL7qr7c5+ERx3zlNSi/3/36ZNKVxAQIKlv////Fg+K0YrUGjG3vh6l9zavQkHmK0oTyYzbbbCAxRMPQBTMiowAWcljtYYZmCOyHi5Qie6cV08TGhaiP1hdCoVumZBscujztLEvbbbYYkMSh6h0obxbI67WrP/+1JgIQABiRtSm28RwB4BaqNh4yQGCGNK7eBHAIUHKumIiJhAC4OyYOzqxlNLbLU0gBU222wbiYFDAwdMJJy4xQFDQfRu
@sylumer
sylumer / gmaen.js
Created June 29, 2020 19:54
TextExpander JavaScript Example: Time of Day Based Greeting
//Get the current hour
let dtNow = new Date();
let dtHour = dtNow.getHours();
//Default to a night message as that overlaps the start and end of a 24 hour period
let strOutput = 'night';
//If we're outside of the night, override the period greeting accordingly
if (dtHour >= 6 && dtHour <= 12 ) strOutput = 'morning';
else if (dtHour >= 12 && dtHour < 18 ) strOutput = 'afternoon';