this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

first

xxwhirlpool 467bedd3

+443
+3
README.md
··· 1 + # misc scripts & programs 2 + 3 + some of these are also in my dotfiles. whatever
+9
getlyr
··· 1 + #!/bin/bash 2 + 3 + artist=$(gum input --placeholder artist | awk '{$1=$1}1' OFS="+") 4 + 5 + song=$(gum input --placeholder song | awk '{$1=$1}1' OFS="+") 6 + 7 + echo -e $(gum style --italic --foreground "#f4b8e4" "'$artist', '$song'") 8 + 9 + curl -s https://api.lyrics.ovh/v1/"$artist"/"$song" | jq -r .lyrics | less
+10
lastfm.py
··· 1 + import urllib.request 2 + import json 3 + url = 'https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${USER}&api_key=${API_KEY}&format=json&limit=1' 4 + req = urllib.request.Request(url) 5 + 6 + slay = urllib.request.urlopen(req).read() 7 + stuff = json.loads(slay.decode('utf-8')) 8 + 9 + for item in stuff['recenttracks']['track'][:1]: 10 + print(item['artist']['#text'],"\n ", item['album']['#text'],"\n ", item['name'])
+54
marvel
··· 1 + #!/bin/bash 2 + # 3 + # unfinished weird little thing i was playing with to query the marvel API 4 + 5 + API_KEY=x 6 + PRIV_KEY=x 7 + TS=1 8 + HASH=$(echo -n ${TS}${PRIV_KEY}${API_KEY} | md5sum | cut -d ' ' -f 1) 9 + 10 + echo -e "what do you want to look up? \n" 11 + 12 + CHOOSE=$(gum choose --limit 1 "characters" "comics" "creators") 13 + 14 + echo -e "what do you want to look up from ${CHOOSE}? \n" 15 + 16 + LOOK=$(gum input --placeholder "type away") 17 + 18 + URL="https://gateway.marvel.com/v1/public/${CHOOSE}?${TYPE}=${LOOK}&apikey=${API_KEY}&ts=${TS}&hash=${HASH}" 19 + 20 + if [ "${CHOOSE}" == "characters" ]; then 21 + echo -e "pick from below \n" 22 + TYPE="name" 23 + CHARA=$(gum choose --limit 1 "comics" "series" "events") 24 + case ${CHARA} in 25 + comics) 26 + echo -n -e "comics starring ${LOOK}: \n\n" 27 + curl -s ${URL} | jq -r ".data.results[].comics.items[].name" 28 + ;; 29 + series) 30 + echo -n -e "series starring ${LOOK}: \n\n" 31 + curl -s ${URL} | jq -r ".data.results[].series.items[].name" 32 + ;; 33 + events) 34 + echo -n -e "events starring ${LOOK}: \n\n" 35 + curl -s ${URL} | jq -r ".data.results[].events.items[].name" 36 + ;; 37 + esac 38 + elif [ "$CHOOSE" == "comics" ]; then 39 + echo -e "pick from below \n" 40 + TYPE="title" 41 + COMIC=$(gum choose --limit 1 "title" "description") 42 + case ${COMIC} in 43 + title) 44 + echo -n -e "comics featuring ${LOOK}: \n\n" 45 + curl -s ${URL} | jq -r ".data.results[].title" 46 + ;; 47 + description) 48 + echo -n -e "comic descriptions with ${LOOK}: \n\n" 49 + curl -s ${URL} | jq -r ".data.results[].description" 50 + ;; 51 + esac 52 + else 53 + echo -e "did you hit ctrl+c" 54 + fi
+13
md2html
··· 1 + #!/bin/bash 2 + # 3 + # generates an HTML file from a supplied MD file in the current working directory 4 + # 5 + # uses a custom pandoc template 6 + 7 + FILE=$(gum input --placeholder "without an extension") 8 + 9 + HTML="pandoc/md2html.html" 10 + 11 + CSS="pandoc/md2html.css" 12 + 13 + pandoc --standalone "$FILE.md" --template=$HTML --no-highlight -o "$FILE.html"
+22
nowplaying
··· 1 + #!/bin/bash 2 + 3 + apikey="" 4 + 5 + user="" 6 + 7 + URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$apikey&format=json&limit=1" 8 + 9 + artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"') 10 + album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"') 11 + song=$(curl -s ${URL} | jq -r '.recenttracks.track[0].name') 12 + 13 + left=$(printf "%s\n%s\n%s\n" "artist" "album" "song") 14 + right=$(printf "%s\n%s\n%s\n" "$artist" "$album" "$song") 15 + 16 + final_left=$(gum style --foreground "#a6d189" --border none --width 20 --margin "1 2" --padding "0 1" --align left "$left") 17 + final_right=$(gum style --foreground "#f4b8e4" --border none --width 20 --margin "1 0" --align left "$right") 18 + 19 + join=$(gum join --horizontal --align right "$final_left" "$final_right") 20 + all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 1" --align center "$join") 21 + 22 + gum join --vertical "$all"
+171
pandoc/md2html.css
··· 1 + @import url('https://unpkg.com/@catppuccin/palette/css/catppuccin.css'); 2 + html { 3 + color: var(--ctp-frappe-base); 4 + background-color: var(--ctp-latte-base); 5 + } 6 + body { 7 + margin: 0 auto; 8 + max-width: 50%; 9 + padding-left: 50px; 10 + padding-right: 50px; 11 + padding-top: 50px; 12 + padding-bottom: 50px; 13 + hyphens: auto; 14 + overflow-wrap: break-word; 15 + text-rendering: optimizeLegibility; 16 + font-kerning: normal; 17 + } 18 + @media (max-width: 600px) { 19 + body { 20 + font-size: 0.9em; 21 + padding: 12px; 22 + max-width: 100%; 23 + } 24 + h1 { 25 + font-size: 1.8em; 26 + } 27 + } 28 + @media print { 29 + html { 30 + background-color: white; 31 + } 32 + body { 33 + background-color: transparent; 34 + color: black; 35 + font-size: 12pt; 36 + } 37 + p, h2, h3 { 38 + orphans: 3; 39 + widows: 3; 40 + } 41 + h2, h3, h4 { 42 + page-break-after: avoid; 43 + } 44 + } 45 + p { 46 + margin: 1em 0; 47 + } 48 + a, a:link, a:visited, a:link:visited { 49 + color: var(--ctp-latte-lavender); 50 + } 51 + a:hover { 52 + text-decoration: none; 53 + color: var(--ctp-latte-text); 54 + } 55 + img { 56 + max-width: 100%; 57 + } 58 + svg { 59 + height: auto; 60 + max-width: 100%; 61 + } 62 + h1, h2, h3, h4, h5, h6 { 63 + margin-top: 1.4em; 64 + color: var(--ctp-frappe-surface0); 65 + } 66 + h5, h6 { 67 + font-size: 1em; 68 + font-style: italic; 69 + } 70 + h6 { 71 + font-weight: normal; 72 + } 73 + ol, ul { 74 + padding-left: 1.7em; 75 + margin-top: 1em; 76 + } 77 + li > ol, li > ul { 78 + margin-top: 0; 79 + } 80 + blockquote { 81 + margin: 1em 0 1em 1.7em; 82 + padding-left: 1em; 83 + border-left: 2px solid #e6e6e6; 84 + color: #606060; 85 + } 86 + code { 87 + font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace; 88 + font-size: 85%; 89 + margin: 0; 90 + hyphens: manual; 91 + } 92 + pre { 93 + margin: 1em 0; 94 + overflow: auto; 95 + padding: 1em; 96 + background: #303446; 97 + } 98 + pre code { 99 + padding: 0; 100 + overflow: visible; 101 + overflow-wrap: normal; 102 + } 103 + .sourceCode { 104 + background-color: transparent; 105 + overflow: visible; 106 + } 107 + hr { 108 + background-color: #1a1a1a; 109 + border: none; 110 + height: 1px; 111 + margin: 1em 0; 112 + } 113 + table { 114 + margin: 1em 0; 115 + border-collapse: collapse; 116 + width: 100%; 117 + overflow-x: auto; 118 + display: block; 119 + font-variant-numeric: lining-nums tabular-nums; 120 + } 121 + table caption { 122 + margin-bottom: 0.75em; 123 + } 124 + tbody { 125 + margin-top: 0.5em; 126 + border-top: 1px solid #1a1a1a; 127 + border-bottom: 1px solid #1a1a1a; 128 + } 129 + th { 130 + border-top: 1px solid #1a1a1a; 131 + padding: 0.25em 0.5em 0.25em 0.5em; 132 + } 133 + td { 134 + padding: 0.125em 0.5em 0.25em 0.5em; 135 + } 136 + header { 137 + margin-bottom: 4em; 138 + text-align: center; 139 + } 140 + #TOC li { 141 + list-style: none; 142 + } 143 + #TOC ul { 144 + padding-left: 1.3em; 145 + } 146 + #TOC > ul { 147 + padding-left: 0; 148 + } 149 + #TOC a:not(:hover) { 150 + text-decoration: none; 151 + } 152 + code{white-space: pre-wrap;} 153 + span.smallcaps{font-variant: small-caps;} 154 + div.columns{display: flex; gap: min(4vw, 1.5em);} 155 + div.column{flex: auto; overflow-x: auto;} 156 + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} 157 + /* The extra [class] is a hack that increases specificity enough to 158 + override a similar rule in reveal.js */ 159 + ul.task-list[class]{list-style: none;} 160 + ul.task-list li input[type="checkbox"] { 161 + font-size: inherit; 162 + width: 0.8em; 163 + margin: 0 0.8em 0.2em -1.6em; 164 + vertical-align: middle; 165 + } 166 + .display.math{display: block; text-align: center; margin: 0.5rem auto;} 167 + 168 + ::selection { 169 + color: var(--ctp-latte-surface1); 170 + background: var(--ctp-frappe-crust); 171 + }
+87
pandoc/md2html.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="utf-8" /> 5 + <meta name="generator" content="pandoc" /> 6 + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> 7 + $for(author-meta)$ 8 + <meta name="author" content="$author-meta$" /> 9 + $endfor$ 10 + $if(date-meta)$ 11 + <meta name="dcterms.date" content="$date-meta$" /> 12 + $endif$ 13 + $if(keywords)$ 14 + <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> 15 + $endif$ 16 + $if(description-meta)$ 17 + <meta name="description" content="$description-meta$" /> 18 + $endif$ 19 + <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> 20 + 21 + <link rel="stylesheet" href="https://unpkg.com/@catppuccin/highlightjs@1.0.1/css/catppuccin-frappe.css"> 22 + 23 + <link rel="stylesheet" href="../md2html.css"> 24 + 25 + <script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script> 26 + 27 + <script> 28 + document.getElementById("sourceCode").classList.add("language "); 29 + </script> 30 + 31 + $for(header-includes)$ 32 + $header-includes$ 33 + $endfor$ 34 + $if(math)$ 35 + $math$ 36 + $endif$ 37 + </head> 38 + <body> 39 + <script>hljs.highlightAll();</script> 40 + $for(include-before)$ 41 + $include-before$ 42 + $endfor$ 43 + $if(title)$ 44 + <header id="title-block-header"> 45 + <h1 class="title">$title$</h1> 46 + $if(subtitle)$ 47 + <p class="subtitle">$subtitle$</p> 48 + $endif$ 49 + <p> 50 + $if(date)$ 51 + published <span class="date">$date$</span> 52 + $endif$ 53 + </p> 54 + <p> 55 + $if(lastmodified)$ 56 + last edited <span class="date">$lastmodified$</span> 57 + $endif$ 58 + </p> 59 + <p> 60 + $for(author)$ 61 + by <a href="https://girlonthemoon.xyz/"><span class="author">$author$</span></a> 62 + $endfor$ 63 + </p> 64 + $if(abstract)$ 65 + <div class="abstract"> 66 + <div class="abstract-title">$abstract-title$</div> 67 + $abstract$ 68 + </div> 69 + $endif$ 70 + </header> 71 + $endif$ 72 + $if(toc)$ 73 + <nav id="$idprefix$TOC" role="doc-toc"> 74 + $if(toc-title)$ 75 + <h2 id="$idprefix$toc-title">$toc-title$</h2> 76 + $endif$ 77 + $table-of-contents$ 78 + </nav> 79 + $endif$ 80 + <article> 81 + $body$ 82 + $for(include-after)$ 83 + $include-after$ 84 + $endfor$ 85 + </article> 86 + </body> 87 + </html>
+74
resizecropspring.sh
··· 1 + #!/bin/bash 2 + # 3 + # quick script to make variants for animated retrospring icons or headers and direct upload to replace a user's existing ones. good for when a user wants to use a specific gif but carrierwave processing glitches it somehow 4 + # 5 + # deps: charmbracelet/gum, imagemagick 6 + 7 + filename=$(gum input --placeholder "without an extension") 8 + 9 + echo -e "header or icon \n" 10 + 11 + CHOOSE=$(gum choose --limit 1 "header" "icon") 12 + 13 + echo -e "you chose ${CHOOSE} \n" 14 + 15 + echo -e "making dirs \n" 16 + 17 + if [ "${CHOOSE}" == "header" ]; then 18 + mkdir web mobile retina original 19 + elif [ "${CHOOSE}" == "icon" ]; then 20 + mkdir large medium small original 21 + else 22 + echo -e "mkdir failed for some reason" 23 + fi 24 + 25 + echo -e "dirs made \n" 26 + 27 + echo -e "copying original from workdir to dedicated folder \n" 28 + 29 + cp ./$filename.gif ./original/$filename.gif 30 + 31 + echo -e "move done \n" 32 + 33 + ORIGW=$(identify -format '%w' ./original/$filename.gif[0]) 34 + ORIGH=$(identify -format '%h' ./original/$filename.gif[0]) 35 + 36 + echo -e "making mobile version \n" 37 + 38 + if [ "${CHOOSE}" == "header" ]; then 39 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 450x105^ /tmp/tmp-header-mobile.gif && magick /tmp/tmp-header-mobile.gif -gravity center -crop 450x105+0+0 +repage ./mobile/$filename.gif 40 + 41 + echo -e "mobile done \n" 42 + 43 + echo -e "making retina version \n" 44 + 45 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 900x210^ /tmp/tmp-header-retina.gif && magick /tmp/tmp-header-retina.gif -gravity center -crop 900x210+0+0 +repage ./retina/$filename.gif 46 + 47 + echo -e "retina done \n" 48 + 49 + echo -e "making web version \n" 50 + 51 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 1500x350^ /tmp/tmp-header-web.gif && magick /tmp/tmp-header-web.gif -gravity center -crop 1500x350+0+0 +repage ./web/$filename.gif 52 + 53 + echo -e "web done \n" 54 + elif [ "${CHOOSE}" == "icon" ]; then 55 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 80x80^ /tmp/tmp-icon-small.gif && magick /tmp/tmp-icon-small.gif -gravity center -crop 80x80+0+0 +repage ./small/$filename.gif 56 + 57 + echo -e "small done \n" 58 + 59 + echo -e "making medium version \n" 60 + 61 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 256x256^ /tmp/tmp-icon-medium.gif && magick /tmp/tmp-icon-medium.gif -gravity center -crop 256x256+0+0 +repage ./medium/$filename.gif 62 + 63 + echo -e "medium done \n" 64 + 65 + echo -e "making large version \n" 66 + 67 + magick -size $ORIGWx$ORIGH^ ./original/$filename.gif -coalesce -resize 500x500^ /tmp/tmp-icon-large.gif && magick /tmp/tmp-icon-large.gif -gravity center -crop 500x500+0+0 +repage ./large/$filename.gif 68 + 69 + echo -e "large done \n" 70 + else 71 + echo -e "img creation failed for some reason idk" 72 + fi 73 + 74 + echo -e "script done"