Skip to content

Instantly share code, notes, and snippets.

View watofundefined's full-sized avatar

Matej Duracka watofundefined

View GitHub Profile
;; Inspired by:
;; https://danielbmarkham.com/fun-with-an-interview-question/
;; https://github.com/smcl/LetterSequencer/blob/master/Interview.LetterSequencer.FSharp/Program.fs
(defn run-length-encode
"Accepts a string (or any seq of characters).
Returns its encoded representation as a seq of char-count tuples.
Example: (aaabb ~> [[a 3][b 2]])"
([s]
(run-length-encode s []))
@watofundefined
watofundefined / rich-already-answered-that.md
Created August 15, 2020 17:56 — forked from reborg/rich-already-answered-that.md
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@watofundefined
watofundefined / syncthing-git-backup.md
Last active December 8, 2023 03:02
Syncthing git backup recipe

Syncthing has awesome docs - start there if you haven't read them already. This is just a recipe to show how I set it up to have a git-versioned backup on Raspberry Pi.

Once machines are talking to each other via Syncthing add the folder through GUI, share it with another device, switch to that device and accept the incoming folder.

Let's say that the folder is ~/org.

On the 'backup' device in Syncthing GUI, go to Folder settings > File Versioning, choose "External File Versioning" and in Command input fill in: git-backup-org %FOLDER_PATH% %FILE_PATH%.

On the 'backup' device create the backup folder and initialize a git repository: