Skip to content

Instantly share code, notes, and snippets.

View evantravers's full-sized avatar
💭
Fooling around in elixir…

Evan Travers evantravers

💭
Fooling around in elixir…
View GitHub Profile
Dir.glob("./**/*.md").each do |file|
filename = File.basename(file, '.md')
content = File.read(file)
lines = content.lines
matching_title = lines.find_index { |l| l.match /^# #{filename}\s*$/ }
if matching_title then
# find block of empty lines
blank_lines = matching_title + 1
@evantravers
evantravers / content.md
Created September 3, 2023 20:54
Gist from Drafts

Nintendo Switch Party Games

We are optimizing for fun with other people, co-op or competitive. I'm ignoring some incredible games that are purely single player, or have a barrier to fun that requires some skill or experience with a particular game-type. Some of the games are very hard, but are fun to fail together.

Ranked roughly in order of chill experiences to stressful shenanigans…

Stardew Valley

🎮: 1-2, 🤝

The smash hit farming sim plays very well on switch. Lots of things to do and explore, and very little stress unless the fishing mini-game stresses you out.

❯ ping www.google.com
PING www.google.com (216.239.38.120): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
hs.loadSpoon('Split')
hs.hotkey.bind({"cmd", "alt"}, "s", function() spoon.Split.split() end)
var Booknotes = {};
Booknotes.__mlaAuthors = function(authors) {
if (authors) {
switch (authors.length) {
case 1: return authors[0]; break;
case 2: return authors.join(", "); break;
case 3: return authors[0] + " et al."; break;
}
} else {
@evantravers
evantravers / things-to-org.md
Last active April 7, 2021 15:10
Playing around with exporting Things 3 data -> emacs orgmode.
@evantravers
evantravers / weekly_reviews.js
Last active October 13, 2023 12:28
Pulling my weekly reviews out of completed Projects in Things.app for use in Obisidian notes
(function() {
let Things = Application("Things");
app = Application.currentApplication()
app.includeStandardAdditions = true
Things.launch();
for (proj of Things.projects().filter(p => p.tagNames().match(/Rituals/) && p.name().match(/Weekly/) && p.status() == 'completed')) {
let d = proj.completionDate()
let formatted_date = `${d.getFullYear()}-${((d.getMonth()+1).toString()).padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`;
let content = `## ${proj.name()}\n\n${proj.notes()}`
things:///json?data=%5B%7B%22type%22%3A%22project%22%2C%22operation%22%3A%22create%22%2C%22attributes%22%3A%7B%22title%22%3A%22Weekly%20Review%3A%202%2F16%2F2021%22%2C%22notes%22%3A%22%22%2C%22tags%22%3A%5B%22Rituals%22%5D%2C%22when%22%3A%22today%22%2C%22items%22%3A%5B%7B%22type%22%3A%22heading%22%2C%22attributes%22%3A%7B%22title%22%3A%22Prep%22%7D%7D%2C%7B%22type%22%3A%22to-do%22%2C%22attributes%22%3A%7B%22title%22%3A%22%F0%9F%93%93%3A%20Review%20journal.%22%7D%7D%2C%7B%22type%22%3A%22to-do%22%2C%22attributes%22%3A%7B%22title%22%3A%22%E2%9C%85%3A%20What%20did%20you%20accomplish%3F%22%2C%22notes%22%3A%22things%3A%2F%2F%2Fshow%3Fid%3Dlogbook%22%7D%7D%2C%7B%22type%22%3A%22to-do%22%2C%22attributes%22%3A%7B%22title%22%3A%22%F0%9F%92%AD%3A%20What%20can%20you%20learn%20from%20last%20week%3F%22%7D%7D%2C%7B%22type%22%3A%22to-do%22%2C%22attributes%22%3A%7B%22title%22%3A%22Do%20a%20brain%20dump.%20Add%20any%20tasks%20or%20projects%20you%20come%20up%20with%20to%20the%20Things%20inbox.%22%7D%7D%2C%7B%22type%22%3A%22to-do

Things Quick Tip: Keyboard Shortcuts for Tags

Things allows you to assign keyboard shortcuts to Tags.

  1. Bring up the tag manager with ⌘⌃T
  2. Notice the little boxes to the right? Click in one and press a key. Tada!

This adds two bindings: if you have a task highlighted and press ⌃+<key>, it'll toggle that tag on and off.

If you are looking at any view, you can press ⌃⌥+ and it'll filter that view to that tag.

#!/bin/bash
#basic newsboat bookmark plugin for instapaper
username=$(op get item "instapaper" | jq '.details.fields[] | select(.designation=="username").value' | tr -d '"')
password=$(op get item "instapaper" | jq '.details.fields[] | select(.designation=="password").value' | tr -d '"')
url="$1"
title="$2"
curl --data-urlencode "title=$title" \