Skip to content

Instantly share code, notes, and snippets.

View lmorchard's full-sized avatar
😅
drinking from multiple firehoses

Les Orchard lmorchard

😅
drinking from multiple firehoses
View GitHub Profile
@lmorchard
lmorchard / substack-to-opml.js
Last active January 25, 2024 17:50
Substack to OPML export
// To use this script:
//
// 1. Copy this whole gist
// 2. Log into your account on substack.com
// 3. On a substack.com page, open the JavaScript console in your browser's web dev tools
// 4. Paste this into the console and hit return.
// 5. You should see substack-publications.opml has been downloaded.
//
// If you'd like to grab this code and improve it or turn it into a better tool, go right ahead!
// Maybe drop me a toot at @lmorchard@hackers.town or @lmorchard@toot.lmorchard.com if you liked it.
@lmorchard
lmorchard / Dockerfile
Created February 27, 2023 03:34
Dockerfile extending bbsio/synchronet to add DOSEMU
FROM bbsio/synchronet:latest
ARG DOSEMU_DEB_URL=http://ftp.us.debian.org/debian/pool/contrib/d/dosemu/dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
ARG DOSEMU_DEB=dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
RUN apt-get update \
&& apt-get install -y rsh-redone-client locales locales-all \
mtools dosfstools dos2unix ser2net socat
ENV USER=root LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
@lmorchard
lmorchard / hub-of-awesome.md
Created January 31, 2023 19:30
Hub of Awesome (2012 Feb)

Hub of Awesome (2012 Feb)

by Les Orchard me@lmorchard.com

Overview

People access the internet through a growing variety of devices, and many people use many devices. And, largely, those devices coordinate through the cloud.

@lmorchard
lmorchard / hub-of-awesome.md
Created January 13, 2020 20:47
Hub of Awesome (decafbad.com/2012/02/hub-of-awesome.md)

Hub of Awesome

by Les Orchard me@lmorchard.com

Overview

People access the internet through a growing variety of devices, and many people use many devices. And, largely, those devices coordinate through the cloud.

@lmorchard
lmorchard / window-follow.ahk
Last active January 29, 2019 19:35
Use AutoHotKey to move an OBS display capture source around to track the current window
#NoEnv
SetBatchLines, -1
; https://github.com/G33kDude/WebSocket.ahk
#Include ./WebSocket.ahk
sceneName := "Show desktop follow"
sourceName := "Desktop"
scale := 0.75
sourceWidth := 1455
sourceHeight := 1080
@lmorchard
lmorchard / obs-mouse-follow.ahk
Created January 25, 2019 22:35
Mouse tracking AutoHotKey script
; Key on mouse region change
!^+v::
ToolTip, start
SetTimer, CheckMouseRegion, 2000
return
!^+b::
ToolTip, stop
SetTimer, CheckMouseRegion, off
return
@lmorchard
lmorchard / package.json
Created March 7, 2018 19:44
Using npm-run-all --parallel in npm scripts
"scripts": {
"start": "npm-run-all --parallel server watch:extension watch:lint",
"server": "cross-env NODE_ENV=development webpack-dev-server --config webpack.web.js",
"watch": "npm-run-all --parallel watch:*",
"watch:web": "cross-env NODE_ENV=development webpack --watch --progress --colors --config webpack.web.js",
"watch:extension": "cross-env NODE_ENV=development webpack --watch --progress --colors --config webpack.extension.js",
"watch:lint": "onchange -p -v \"src/**/*.js\" -- npm run lint",
"lint": "eslint --color .",
},
@lmorchard
lmorchard / index.js
Created March 7, 2018 19:42
Hacky loader that waits until initial Redux store changes settle down
const unsubscribeLoader = store.subscribe(() => {
if (selectors.loaderDelayExpired(store.getState())) {
// State settled down long enough for timer to expire - stop listening.
unsubscribeLoader();
} else {
// Reset the timer again.
startLoaderDelay();
}
});
@lmorchard
lmorchard / index.js
Created March 7, 2018 19:41
Redux middleware sending messages to add-on on state changes
const postMessage = (type, data = {}) =>
window.postMessage(
{ ...data, type, channel: `${CHANNEL_NAME}-extension` },
"*"
);
const updateExtensionThemeMiddleware = ({ getState }) => next => action => {
const returnValue = next(action);
const meta = action.meta || {};
if (!meta.skipAddon && themeChangeActions.includes(action.type)) {
@lmorchard
lmorchard / background.js
Created March 7, 2018 19:40
Dispatching messages from web content in an add-on
const messageListener = port => message => {
let theme;
switch (message.type) {
case "fetchTheme":
log("fetchTheme");
fetchTheme().then(({ theme: currentTheme }) =>
port.postMessage({ type: "fetchedTheme", theme: currentTheme })
);
break;
case "setTheme":