Skip to content

Instantly share code, notes, and snippets.

@hraftery
hraftery / merge_roam_daily.pl
Created April 18, 2021 09:28
Merge all the daily pages from Roam Research into one markdown file with date headings
#!/usr/bin/perl -w
use Time::Piece;
%dailies = ();
foreach my $daily (<*.md>)
{
my $fn = $daily; #store original for use later
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hraftery
hraftery / Installing_nRF_Connect_SDK_on_macos.md
Last active July 27, 2021 21:25
Installing nRF Connect SDK on macos

Installing nRF Connect SDK on macos

Conditions

  • Applicable to the nRF9160-DK and probably other platforms the SDK supports.
  • Correct as at 2021-04-07. Many fast moving parts so will likely age quickly.

Instructions

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hraftery
hraftery / Alphametics.hs
Created November 10, 2021 03:00
My Haskell solution to the "Alphametics" challenge at https://exercism.org/tracks/haskell/exercises/alphametics
module Alphametics (solve) where
import Data.Char (isSpace)
import Data.List (nub, intersect, transpose, elemIndex)
import Data.Maybe (fromJust)
solve :: String -> Maybe [(Char, Int)]
solve input = if length solutions == 1 then Just $ zip charMap (head solutions) else Nothing
where
toRowsOfChars = wordsBy "+=" -- create list of words from input (["SEND","MORE","MONEY"])
umount: /dev: target is busy.
mount: /sys/kernel/debug: nodev already mounted on /sys/kernel/debug.
QFactoryLoader::QFactoryLoader() checking directory path "/qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /qt/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"

Email Migration with Dovecot

Notes on migrating 20 years of personal email from dovecot on an iMac to Synology Mail Server on a DS920+.

Preparation

setting FROM TO
host corroboree.hrsoftworks.net REDACTED
version 2.2.18 2.3.5.2 (a83ad21)
@hraftery
hraftery / getmail_on_dsm7.md
Created July 31, 2022 13:09
Installing getmail on Synology Diskstation DS920+ with DSM 7

Installing getmail on Synology Diskstation DS920+ with DSM 7

  • Did a survey of alternatives and am not convinced there's better out there. The built-in Synology stuff might be capable, but I don't think it's going to be as set-and-forget. So getmail it is.
  • Right, no getmail in the official Synology repositories, but it is in ipkg apparently. So just install that like last time right? Nope. It's opkg now, and the installer doesn't work on DSM 7!
    • Wow, not getting far.
  • Okay, official instructions work just fine (the DS920+ is x86_64, according to uname -a), but need to wait for a reboot and I still have 5 hours of backup copying to go.
  • So in meantime, notice that the opkg getmail package seems to be v4 anyway, and v5 is available. So why not just install it manually?
wget https://pyropus.ca./software/getmail/old-versions/getmail-5.16.tar.gz # note
/*
* Perform a basic text search of all (internally generated) chat messages in Jellyfish, like Omnisearch used to do for Flowdock.
*
* Usage:
* 1. Change `theSearchPattern` to the string you're searching for
* 2. Enter line in the Console in the Developer Tools in the browser, after logging into Jellyfish.
* 3. The first 20 results will appear in the console. To see more, press up and return to re-enter the last command.
*
* In case it wasn't clear, this is a terrible hack and not expected to be fit for anything beyond amusement.
*/
@hraftery
hraftery / FetchTasksFromClickup.gs
Created November 7, 2022 02:51
Fetch tasks from the ClickUp API, returning the fields specified as a two dimensional array.
/*
* FetchTasksFromClickup
*
* A simple function to fetch tasks using the ClickUp API and return the fields specified as a two-dimensional array.
* This can be used in a Google Apps Script to pull task data into a Google Sheet.
*
* Author: Heath Raftery
* License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a
* letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.