Skip to content

Instantly share code, notes, and snippets.

View ScottJWalter's full-sized avatar
🔮
Particle. Wave. It's all data.

Scott Walter ScottJWalter

🔮
Particle. Wave. It's all data.
View GitHub Profile
@Zyrohex
Zyrohex / custom.js
Last active January 28, 2024 09:08
function collapseAndAbbreviateNamespaceRefs() {
const observer = new MutationObserver((mutationList) => {
for (const mutation of mutationList) {
for (const node of mutation.addedNodes) {
if (!node.querySelectorAll) continue;
const initialNamespaceRefs = node.querySelectorAll(
'.ls-block a.page-ref[data-ref*="/"], .foldable-title [data-ref*="/"], li[title*="root/"] .page-title, a.tag[data-ref*="/"]'
);
const pageTitleRefs = node.querySelectorAll('.page-title');
@dannberg
dannberg / obsidian-people-template.txt
Last active April 11, 2025 07:39
Dann Berg's People Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. See full tutorial for setup instructions: https://dannb.org/blog/2022/obsidian-people-note-template/
---
company:
location:
title:
email:
website:
aliases:
---
tags:: [[👥 People MOC]]
@Azurewren
Azurewren / Automated Periodic Note Creation.md
Last active December 31, 2024 21:24
Automated Periodic Note Creation

This is a Templater Startup Script for use in Obsidian.

Each time Obsidian is opened, Templater runs the script to see if a weekly, monthly, quarterly, and yearly file exists for the current date. If one exists, it moves on, if not, it creates the file using the appropriate template, in the appropriate place.

<%*
let wk = tp.date.now('GGGG-[W]WW');
let mnth = tp.date.now('MM MMMM');
let qrtr = tp.date.now('Qo [Quarter]');
let yr = tp.date.now('YYYY');
@atmason90
atmason90 / regex-tutorial.md
Last active March 25, 2024 10:54
Regular Expression Tutorial - Matching a URL

Regular Expression Tutorial - Matching a URL

In this tutorial, we will examine a regular expression for matching a URL. Using this example, we can begin to build a basic understanding of regular expressions, what each component represents, how they can be implemented in code to define search patterns, and how they can be used to validate that certain strings match specific criteria.

Summary

As previously stated, the following regular expression can be used to validate that a string is, in fact, a URL

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/

@TfTHacker
TfTHacker / FastStart-StartupScript.js
Last active February 9, 2025 10:33
FastStart Script for Obsidian - makes it easy to delay the startup of plugins
<%*
fastStart = async (filename, delayInSecond) => {
if (tp.file.exists(filename)) {
const f = tp.file.find_tfile(filename);
let plugins = (await app.vault.read(f)).split(/\r?\n/);
setTimeout(async () => {
plugins.forEach(async (p) => await app.plugins.enablePlugin(p))
}, delayInSecond * 1000)
}
}
@sindresorhus
sindresorhus / esm-package.md
Last active April 18, 2025 01:47
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@AlexMikhalev
AlexMikhalev / get-obsidian-posts.py
Created January 19, 2021 13:46
Sync notion to obsidian world md
from notion.client import NotionClient
import datetime
import os
from slugify import slugify
import re
import requests
import time
import hashlib
import shutil
import sys
@FreddieOliveira
FreddieOliveira / docker.md
Last active April 18, 2025 15:24
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@mob-sakai
mob-sakai / _README.md
Last active March 31, 2025 16:21
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
##
# Copyright (c) 2020 Valentin Weber
#
# After some minor modifications (as marked below) this EventGhost
# Python script provides a method to send requests to devices
# registered with the Join API <https://joaoapps.com/join/api/> from
# any EventGhost Python Script or Command.
#
# EventGhost usage: `eg.globals.JoinPushDevice(text="hello_world")`
##