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
@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()}`
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.

// Safe defaults
var path_fragment = "";
var filename = draft.processTemplate("[[safe_title]]");
var content = draft.content;
var diaryFormat = {};
if (/dbox:(.+)$/m.test(draft.content))
{
app.queueAction(Action.find("Save to Dropbox Path"), draft);
-- stolen from: https://gist.github.com/gabeanzelini/1931128eb233b0da8f51a8d165b418fa
if (count of theSelectionFromBrave()) is greater than 0 then
set str to "tags: #link
" & theTitleFromBrave() & "
> " & theSelectionFromBrave() & "
[" & theTitleFromBrave() & "](" & theCurrentUrlInBrave() & ")"
January 13, 2003
One Hundred Interesting Mathematical Calculations, Number 7
One Hundred Interesting Mathematical Calculations, Number 7: Julius Caesar's Last Breath
What's the chance that the breath you just inhaled contains at least one air molecule that was in Julius Caesar's last breath--the one in which he said (according to Shakespeare) "Et tu Brute? Then die Caesar"?
Assume that the more than two thousand years that have passed have been enough time for all the molecules in Caesar's last breath to mix evenly in the atmosphere, and that only a trivial amount of the molecules have leaked out into the oceans or the ground. Assume further that there are about 1044 molecules of air, and about 2 x 1022 molecules in each breath--yours or Caesar's.
That gives a chance of 2 x 1022/1044 = 2x 10-22 that any one particular molecule you breathe in came from Caesar's last breath. This means that the probability that any one particular molecule did not come from Caesar's last breath is [1-2x10-22]. But we want the
❯ 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 {
Sites:
instapaper.com (simple bookmarking for putting links off till later)
delicious.com (taggable bookmarking for saving links forever)
google.com/voice (managing all your phones, free texting, transcriptions)
google.com/reader (RSS reader)
gmail.com (mail)
stackoverflow.com (best source of help for programming)
dropbox.com (getting at my files on teh go)
dimdim.com (better than gotomeeting, less annoying, free)
http://myfav.es/ (good start page with keyboard shortcuts)