Skip to content

Instantly share code, notes, and snippets.

@replete
replete / ToggleFileExplorer.ahk
Created September 1, 2024 17:35
Autohotkey v2 script for docked File Explorer bound to ALT+\
#Requires AutoHotkey v2.0
; Show file explorer 100% width docked bottom on hotkey.
; This uses https://files.community app Files,but you could change exeName to explorer.exe or anything else
; Bind the hotkey ALT+\
!\::ToggleFilesExe()
ToggleFilesExe() {
; Bind to your file explorer app, I prefer
exeName := "files.exe"
@replete
replete / statamicDevReferenceDashDocset.js
Created July 6, 2024 12:23
statamic.dev reference to Dash Docset
// npm install axios cheerio sqlite3 plist fs-extra
// WIP, too busy to finish this
const axios = require('axios');
const cheerio = require('cheerio');
const fs = require('fs-extra');
const path = require('path');
const sqlite3 = require('sqlite3').verbose();
const plist = require('plist');
const BASE_URL = 'https://statamic.dev';
@replete
replete / getWOTD.js
Created April 9, 2024 15:30
Mirriam-Webster Word of The Day - Templater User Script for Obsidian.md
// Mirriam-Webster WOTD Templater User Script:
// Include this file in your Templater plugin User Scripts folder
// Use within your daily note templater template like this:
// <% tp.user.getWOTD(tp.date.now("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-DD")) %>
function fetchWordOfTheDay() {
const rssUrl = 'https://www.merriam-webster.com/wotd/feed/rss2';
return new Promise((resolve, reject) => {
@replete
replete / instagramURLripper.js
Created March 2, 2024 14:44
Save all URLs from Instagram saved page on desktop
if (!window.ripperLinks) window.ripperLinks = [];
window.ripperCount = 0;
window.ripperFunc = function(){
document.querySelectorAll('article [role=link]').forEach(el => {
ripperLinks.push(el.href);
});
let uniqueLinks = ripperLinks.filter(function(elem, index, self) {
return index === self.indexOf(elem);
});
ripperLinks = uniqueLinks;
@replete
replete / chesscomapi.js
Created June 9, 2023 09:58
get game data from chess.com API
//https://api.chess.com/pub/player/{username}/games/2023/02
(async function main () {
async function getChessGamesForMonth(username, year, month) {
const res = await fetch(`https://api.chess.com/pub/player/${username}/games/${year}/${month}`);
if (res.ok) {
const data = await res.json();
return data.games
} else {
console.error('Problem loading chess.com games from API', res);
@replete
replete / wc-weather.js
Created June 9, 2023 09:56
Obsidian render 3day weather from wc - incomplete js
let data = {
"current_condition": [
{
"FeelsLikeC": "5",
"FeelsLikeF": "41",
"cloudcover": "75",
"humidity": "53",
"localObsDateTime": "2023-02-23 03:03 PM",
"observation_time": "03:03 PM",
"precipInches": "0.0",
@replete
replete / userChrome.css
Last active August 28, 2022 20:14
userchrome.css Firefox 100-ish+ MacOS Dark mode browser.uidensity = 1
/*
@replete's userChrome.css
https://gist.github.com/replete/ba62b8bc9cf61c1e1f8a2ac2eb3907f9
multi-row styles taken from:
https://github.com/MrOtherGuy/firefox-csshacks
compact toolbar styles stolen from somewhere before I decided to do a better job of it
Tweaked these two contributions a bit, but can't remember what I did. My styles are at the bottom
@replete
replete / bitbucket-pipelines-deploy-to-ftp.txt
Last active March 15, 2022 23:04
Bitbucket Pipelines deploy to FTP
Step 1:
Create a new Bitbucket pipeline with the following yaml, then add environment variables (in the bitbucket web UI) for FTP_HOST, FTP_USERNAME, FTP_PASSWORD - update host path below accordingly.
Step 2: Commit this file, once a build passess successfully and it has initialized Git FTP, proceed to Step 3
```bitbucket-pipelines.yml
image: atlassian/default-image:3
pipelines:
default:
@replete
replete / pino.colorisedTerminalTransformTransport.mjs
Created October 23, 2021 22:36
Pino v7 logger transport transformer to console.log colorized terminal output, for use within a pino transport pipeline
import { Writable } from 'stream'
export default (options) => {
const levels = {
// https://github.com/pinojs/pino/blob/master/docs/api.md#logger-level
10: `\x1b[2m[>]\x1b[0m`, //trace
20: `\x1b[35m[DEBUG]\x1b[0m`, //debug
30: `\x1b[36m[>]`, //info
40: `\x1b[33m[?]`, //warn
50: `\x1b[31m[!]`, //error
@replete
replete / bootstrap.sh
Created October 23, 2021 16:48
Node/mongo application bootstrap script WIP
#!/bin/bash
log() { echo -e "\x1b[0m\033[1;30m$(date +%H:%M:%S)\x1b[0m $@ \x1b[0m" ; }
INFO='\x1b[0m\033[1;30m[>]\x1b[0m'
OK='\x1b[0m\033[1;32m[✔]\x1b[0m'
WARN='\x1b[0m\033[1;33m[?]'
ERROR='\x1b[0m\033[1;31m[!]'
NODEVER=v17.0.1
MONGODBNAME=appdb