Skip to content

Instantly share code, notes, and snippets.

View selfawaresoup's full-sized avatar
💜

Esther Weidauer selfawaresoup

💜
View GitHub Profile
@selfawaresoup
selfawaresoup / .env
Created September 1, 2022 16:47
Basic dotenv-cli in pure bash
WHATEVER="SOMETHING"
@selfawaresoup
selfawaresoup / merge-logs.sh
Created August 11, 2022 14:55
Merge CSV access logs
#!/usr/bin/env bash
# merges CSV webserver access logs (like the ones FastMail provides for their static website hosting)
# into a new file, removing duplicate entries and sorting by date descending
LOGS=$(find . -name "access-log-*.csv" -type f)
echo "" > .temp
for L in $LOGS
@selfawaresoup
selfawaresoup / 00-youtube-dl-tmux.md
Last active May 23, 2022 21:51
Parallel youtube-dl with tmux

to get a list of URLs from a video listing page:

Array.from(document.querySelectorAll('#items a#video-title')).map(a => a.href).join('\n')

put that into a urls file, or gather the URLs some other way

then follow the instructions at https://github.com/dandv/convert-chrome-cookies-to-netscape-format for getting youtube cookies in netscape format in netscape-cookies.txt.

@selfawaresoup
selfawaresoup / magnus.rb
Last active January 16, 2022 12:18
Magnus Archives Archive
#!/usr/bin/env ruby
<<~WHY
Because who knows how long the RSS feed for The Magnus Archives will remain available.
This script will download all the episodes titled "MAG ...", so none of the table-top gaming sessions and behind the scenes stuff they did after the show ended and none of the promo stuff for other podcasts.
It'll also create a nice little HTML file that lists them in the right order from beginning to end with embedded audio players for each episode.
What you need:
@selfawaresoup
selfawaresoup / adventure.js
Last active March 14, 2021 16:30
small demo of a flexible text adventure engine
/**
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@selfawaresoup
selfawaresoup / 17.rb
Last active December 21, 2020 17:12
Project Euler Problems
module Seventeen
WORDS = {
1000000 => "million",
1000 => "thousand",
100 => "hundred",
90 => "ninety",
80 => "eighty",
70 => "seventy",
60 => "sixty",
50 => "fifty",
@selfawaresoup
selfawaresoup / squash.md
Last active July 10, 2017 14:47
Squashing a feature branch in Git before merging

Squashing a feature branch in Git before merging

Note: This tutorial uses default instead of master for the main branch of a Git repository. See this Django PR: https://code.djangoproject.com/ticket/22667

The scenario is as follows:

There is a default branch where features are merged when they're done. Whenever you work on a feature or bugfix, you checkout the latest default and create a new feature branch:

@selfawaresoup
selfawaresoup / basics.clj
Last active January 13, 2016 21:35
Overview of Clojure syntax and some other basics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;primitive types ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42 ;;java.lang.Long
42.0 ;;java.lang.Double
"foo" ;;java.lang.String