Skip to content

Instantly share code, notes, and snippets.

Avatar
🍍

seanbreckenridge

🍍
View GitHub Profile
View anime_manga_genres_php_codegen.sh
#!/bin/bash
# pass 'manga' as the first arg to the script to scrape manga instead
# requires https://github.com/ericchiang/pup to be installed
sort_by_id() {
sort -n -t= -k 2
}
scrape_type="${1:-anime}"
case "${scrape_type}" in
@seanbreckenridge
seanbreckenridge / anilist_413.py
Last active May 17, 2021
cleans up my MAL export so thats its importable to anilist
View anilist_413.py
#!/usr/bin/env python3
# cleans up my MAL export according to this thread:
# https://anilist.co/forum/thread/3291
# so that its importable
# otherwise the graphql error fails with a 413 request entity too large
# since the anilist page just inlines the XML contents into the gql query
import sys
import typing
from pathlib import Path
View chomp.sh
/home/sean/.config/i3blocks/blocks/b-todo:14:chomp <"${TODO_DIR}/todo.txt" | wc -l
/home/sean/.config/yadm/android_bootstrap:82:havecmd chomp || go install github.com/seanbreckenridge/chomp@latest
/home/sean/.config/yadm/package_lists/go_packages.txt:13:chomp github.com/seanbreckenridge/chomp
/home/sean/.local/scripts/linux/colorize_number:7:NUM="${1:-$(chomp | tr -d "\n")}"
/home/sean/.local/share/shortcuts/group-and-termgraph:4:chomp | sort | uniq -c | awk '{print $2 " " $1}' | termgraph | chomp | awk '{print $NF,$0}' | sort -n | cut -f2- -d' '
/home/sean/.local/share/shortcuts/moviesearch:3:SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/sean/.local/share/shortcuts/moviesearch-letterboxd:3:[ -z "$SEARCH_STR" ] && SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/sean/.local/share/shortcuts/moviesearch-trakt:3:[ -z "$SEARCH_STR" ] && SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/sean/.local/share/shortcuts/synonym:3:mo
View discord_html.diff
diff --git a/my/discord.py b/my/discord.py
index 15730f6..6a7e1f6 100644
--- a/my/discord.py
+++ b/my/discord.py
@@ -3,6 +3,8 @@ Discord Data: messages and events data
"""
REQUIRES = [
"git+https://github.com/seanbreckenridge/discord_data",
+ "mistletoe",
+ "urlextract",
View promnesia.html
<li data-sources="promnesia_sean.sources.discord"><div><span id="relative_indicator"><a href="https://myanimelist.net/profile/purplepinapples">➤➤</a></span><span><span class="index" title="index (for easier match against highlights)">5</span><span class="src promnesia_sean_sources.discord">promnesia_sean.sources.discord</span></span><span class="datetime" title="search around"><span class="time">19:23</span><span class="date">21 May 2020</span></span></div><div class="context">any IP I spin up to try and get a request from getts
```
curl '<a href="https://myanimelist.net/profile/purplepinapples">https://myanimelist.net/profile/purplepinapples</a>' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: <a href="https://myanimelist.net/">https://myanimelist.net/</a>' -H 'Connection: keep-alive' -H 'Cookie: MALSESSIONID=MALHLOGSESSI
View projects_000001.json
[
{
"type": "project",
"url": "https://github.com/seanbreckenridge/albums/projects/1",
"owner": "https://github.com/seanbreckenridge/albums",
"creator": "https://github.com/seanbreckenridge",
"name": "albums",
"body": "",
"number": 1,
"public": true,
View hpi_doctor.log
✅ OK : my.body
✅ - stats: {'teeth': {'count': 15}, 'shower': {'count': 1}, 'weight': {'count': 10}}
✅ OK : my.browsing
[D 201021 12:36:37 save_hist:66] backing up /home/sean/.mozilla/firefox/lsinsptf.dev-edition-default/places.sqlite to /tmp/tmp_0kp6_x9/places-20201021193637.sqlite
[D 201021 12:36:37 save_hist:70] done!
[D 201021 12:36:37 merge_db:48] merging information from 4 databases...
[D 201021 12:36:37 parse_db:69] Parsing visits from /home/sean/data/firefox/dbs/places-20200828223058.sqlite...
[D 201021 12:36:37 parse_db:88] Parsing sitedata from /home/sean/data/firefox/dbs/places-20200828223058.sqlite...
[D 201021 12:36:38 parse_db:69] Parsing visits from /home/sean/data/firefox/dbs/places-20200919030959.sqlite...
[D 201021 12:36:39 parse_db:88] Parsing sitedata from /home/sean/data/firefox/dbs/places-20200919030959.sqlite...
View not_in_playlist.bash
#!/bin/bash
# lists any songs in my music folder that aren't in any playlists
# https://github.com/seanbreckenridge/plaintext-playlist
# get list of all songs
ALL_SONGS="$(plainplay listall "$(plainplay playlistdir)"/*)"
# move to my music directory
cd "$PLAINTEXT_PLAYLIST_MUSIC_DIR" || {
echo "Couldn't cd to music directory" 1>&2
View httpx.patch
diff --git a/src/ghexport/dal.py b/src/ghexport/dal.py
index 200a432..a3c78d6 100755
--- a/src/ghexport/dal.py
+++ b/src/ghexport/dal.py
@@ -10,7 +10,7 @@ from .exporthelpers import dal_helper, logging_helper
from .exporthelpers.dal_helper import PathIsh, Json
-logger = logging_helper.logger('ghexport')
+logger = logging_helper.logger('ghexport', level='INFO')
@seanbreckenridge
seanbreckenridge / hpi_doctor.txt
Created Sep 30, 2020
HPI doctor output after merge
View hpi_doctor.txt
✅ config file: /home/sean/.config/my/my/config/__init__.py
✅ mypy config check: success
Success: no issues found in 4 source files
✅ OK : my.body
✅ - stats: {'teeth': {'count': 5}, 'shower': {'count': 1}, 'weight': {'count': 7}}
✅ OK : my.browsing
✅ - stats: {'history': {'count': 120594}}
✅ OK : my.coding
✅ - stats: {'commits': {'count': 5147}, 'repos': {'count': 118}}
✅ OK : my.facebook