diff options
Diffstat (limited to 'stuff')
34 files changed, 1207 insertions, 0 deletions
diff --git a/stuff/EnchantedToolsPack_v1.zip b/stuff/EnchantedToolsPack_v1.zip Binary files differnew file mode 100644 index 0000000..cc83984 --- /dev/null +++ b/stuff/EnchantedToolsPack_v1.zip diff --git a/stuff/beat/digital.css b/stuff/beat/digital.css new file mode 100644 index 0000000..553d078 --- /dev/null +++ b/stuff/beat/digital.css @@ -0,0 +1,10 @@ +@font-face { + font-family: beat; + src: url("../fonts/DS-DIGI.ttf"); +} +body { + font-family: beat, monospace; + color: lime; + text-shadow: 0 0 3px #5ff508; + background: black; +}
\ No newline at end of file diff --git a/stuff/beat/frame.php b/stuff/beat/frame.php new file mode 100644 index 0000000..5143943 --- /dev/null +++ b/stuff/beat/frame.php @@ -0,0 +1,41 @@ +<?php + function beat() { + return '@'.date("B"); + } +?> + +<!DOCTYPE html> +<html lang="en"> + +<head> + <title><?php echo beat(); ?></title> + <?php + $theme = $_GET['theme']; + echo "<link href='$theme.css' rel='stylesheet' type='text/css' media='all'>"; + ?> + <style> + html, body { + height: 100%; + margin: 0; + padding: 0; + } + body { + display: flex; + align-items: center; + justify-content: center; + font-size: 25px; + } + a { + text-decoration: inherit; + color: inherit; + } + </style> +</head> + +<body> + <main> + <a target="_blank" href="/stuff/beat/"><?php echo beat(); ?></a> + </main> +</body> + +</html>
\ No newline at end of file diff --git a/stuff/beat/index.php b/stuff/beat/index.php new file mode 100644 index 0000000..16b7054 --- /dev/null +++ b/stuff/beat/index.php @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title><?php echo '@'.date("B"); ?></title> + <link href="/style.css" rel="stylesheet" type="text/css" media="all"> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> + <style> + .beatframe { + width: 100%; + display: flex; + justify-content: center; + margin: .5rem 0; + } + </style> + </head> + <body> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); ?> + <h1 style="background-image: unset;">.beat</h1> + <h2 id="caption"><?php echo '@'.date("B"); ?></h2> + <nav> + <a href="https://en.wikipedia.org/wiki/Swatch_Internet_Time">Swatch Internet Time (Wikipedia)</a> + </nav> + <h2>88x31 Embeds</h2> + <div class="beatframe"> + <iframe src="https://isopod.cool/stuff/beat/frame.php?theme=digital" style="width: 84px; height: 27px;"></iframe> + </div> + <pre><code><iframe src="https://isopod.cool/stuff/beat/frame.php?theme=digital" style="width: 84px; height: 27px;"></iframe></code></pre> + <div class="beatframe"> + <iframe src="https://isopod.cool/stuff/beat/frame.php?theme=pixel" style="width: 84px; height: 27px;"></iframe> + </div> + <pre><code><iframe src="https://isopod.cool/stuff/beat/frame.php?theme=pixel" style="width: 84px; height: 27px;"></iframe></code></pre> + <div class="beatframe"> + <iframe src="https://isopod.cool/stuff/beat/frame.php?theme=sketch" style="width: 84px; height: 27px;"></iframe> + </div> + <pre><code><iframe src="https://isopod.cool/stuff/beat/frame.php?theme=sketch" style="width: 84px; height: 27px;"></iframe></code></pre> + </body> +</html> diff --git a/stuff/beat/pixel.css b/stuff/beat/pixel.css new file mode 100644 index 0000000..20f3f37 --- /dev/null +++ b/stuff/beat/pixel.css @@ -0,0 +1,10 @@ +@font-face { + font-family: beat; + src: url("../fonts/slkscr.ttf"); +} +body { + font-family: beat, monospace; + color: gainsboro; + background: rgb(255,0,178); + background: linear-gradient(27deg, rgba(255,0,178,1) 0%, rgba(53,0,182,1) 81%); +}
\ No newline at end of file diff --git a/stuff/beat/sketch.css b/stuff/beat/sketch.css new file mode 100644 index 0000000..34b7b87 --- /dev/null +++ b/stuff/beat/sketch.css @@ -0,0 +1,13 @@ +@font-face { + font-family: beat; + src: url("../fonts/firsttimewriting.ttf"); +} +body { + font-family: beat, sans-serif; + font-weight: bold; + color: black; + background-image: repeating-linear-gradient(0deg, #a2ddee, #a2ddee 1px, transparent 1px, transparent); + background-size: 23px 23px; + background-color: #f7f7f7; + background-position: 5px 5px; +}
\ No newline at end of file diff --git a/stuff/beat/time.php b/stuff/beat/time.php new file mode 100644 index 0000000..e3e9596 --- /dev/null +++ b/stuff/beat/time.php @@ -0,0 +1,4 @@ +<?php +header('Content-Type:text/plain'); +echo '@'.date("B"); +?>
\ No newline at end of file diff --git a/stuff/bg.jpg b/stuff/bg.jpg Binary files differnew file mode 100644 index 0000000..cac00e8 --- /dev/null +++ b/stuff/bg.jpg diff --git a/stuff/bg.jxl b/stuff/bg.jxl Binary files differnew file mode 100644 index 0000000..2377a2b --- /dev/null +++ b/stuff/bg.jxl diff --git a/stuff/dirtomp3.sh b/stuff/dirtomp3.sh new file mode 100644 index 0000000..ac75c20 --- /dev/null +++ b/stuff/dirtomp3.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# This is a simple script I wrote to convert my entire music library to mp3s for putting on my phone. +# You need to have ffmpeg installed with support for all relevant formats for this to work. + +# HOW TO USE: +# Place this script in the directory that your library's root directory is in, i.e. if your music +# library is in ~/Music/Library, this script should be located at ~/Music/dirtomp3.sh +# Set the variable "root" to the name of your library's root directory +# Set "newroot" to the desired root directory of the output. This will be created if it doesn't exist. +# The script should take care of the rest. + +root="Library" +newroot="Library_mp3" +mvcount=0 +tdcount=$(($(find "$root" -type f -not -path '*/.*' | wc -l))) + +printf "\x1b[s" +echo ".00% done ($mvcount/$tdcount files processed)" + +recurse() { + path="$1" + for f in "$path/"*; do + nf=$(echo "$f" | sed "s/^$root/$newroot/;s/\.flac\|\.wav\|\.ogg$/.mp3/") + if [[ "$f" != $root* ]]; then + echo "Script attempted to access item $f outside designated operating area, aborting" + exit + fi + if [[ "$nf" != $newroot* ]]; then + echo "Script attempted to access item $nf outside designated operating area, aborting" + exit + fi + if [[ -d "$f" ]]; then + mkdir -p "$nf" + recurse "$f" + elif [[ -f $f ]]; then + printf "\x1b[2K%s" "$(echo "$f" | head -c $(tput cols))" + if [[ "$f" == *.flac ]] || [[ "$f" == *.wav ]] || [[ "$f" == *.ogg ]]; then + if [[ ! -f $nf ]] || [[ $f -nt $nf ]]; then + ffmpeg -i "$f" "$nf" -loglevel 0 + if [[ $? -gt 0 ]]; then + exit + fi + fi + elif [[ "$f" == *.mp3 ]]; then + cp -u "$f" "$nf" + elif [[ "$f" == *.png ]] || [[ "$f" == *.jpg ]] || [[ "$f" == *.jxl ]] || [[ "$f" == *.gif ]]; then + cp -u "$f" "$nf" + fi + mvcount=$((mvcount+1)) + printf "\x1b[u%s%% done (%d/%g files processed)\n" "$(echo "scale=2; $(echo "$mvcount/$tdcount*100" | bc -l)/1" | bc)" "$mvcount" "$tdcount" + fi + done +} + +mkdir -p $newroot +recurse "$root" +printf "\x1b[2K" diff --git a/stuff/firefoxrss/feed.php b/stuff/firefoxrss/feed.php new file mode 100644 index 0000000..0f7cb17 --- /dev/null +++ b/stuff/firefoxrss/feed.php @@ -0,0 +1,62 @@ +<?php +// This is a simple RSS bridge type script intended to generate a basic RSS feed for Firefox releases by scraping https://mozilla.org/firefox/notes/ +// TODO: Add the contents of the page to the RSS entry + +if($_GET['downloadsource'] == 'yes') { // just serve the source code as plain text and exit + header('Content-Type: text/plain'); + echo file_get_contents('feed.php'); + die(); +} + +// In order to reduce the load this puts on both Mozilla's servers and mine, I cache the output of this script for 1 hour. (3600 seconds) +// I could cache it for longer, say a day, but that would significantly increase my chances of updating my browser before +// the release notes appear in my RSS reader, which is simply unacceptable. +$fname = "feed_cached.xml"; +$cacheperiod = 3600; +$cache_too_old = (time() - filemtime($fname) > $cacheperiod); + +if($cache_too_old) { + $url = "https://mozilla.org/firefox/notes/"; + if(function_exists('curl_init')) { + $ch = curl_init($url); + + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, 0); + + $str = curl_exec($ch); + if(curl_error($ch)) { + echo curl_error($ch); + die(); + } + curl_close($ch); + } else { // If the cURL library isn't installed, just use file_get_contents() + $str = file_get_contents($url); + } + + preg_match('/(<div class="c-release-version">([0-9]|\.)+<\/div>)/', $str, $rcs); // extract the element containing the version number + preg_match('/([0-9]|\.)+/', $rcs[0], $rs); // extract the version number from that + $rel = $rs[0]; + + $link = "https://www.mozilla.org/en-US/firefox/".$rel."/releasenotes"; // construct a permalink to the patch notes for the current latest release in particular + + preg_match('/(<p class="c-release-date">.+<\/p>)/', $str, $odcs); // extract the element containing the release date + $origdate = str_replace('</p>', "", str_replace('<p class="c-release-date">', "", $odcs[0])); // extract the date string + $udate = strtotime($origdate) + 43200; // convert said date string to the unix timestamp for noon GMT on that date + $rssdate = "D, d M Y H:i:s"; + $date = date($rssdate, $udate); // convert unix timestamp to the date format RSS uses + + $updatetime = date($rssdate, filemtime($fname)); // generating some data to fill out optional elements of the RSS feed. + $ttl = $cacheperiod / 60; // This is the sole reason why a few variables exist. + + $output = "<rss version=\"2.0\"><channel><title>Firefox Release Notes</title><link>https://www.mozilla.org/firefox/releases/</link><description>Release notes for new versions of Firefox, updated every $ttl minutes</description><language>en-us</language><pubDate>$date</pubDate><lastBuildDate>$updatetime</lastBuildDate><docs>https://www.rssboard.org/rss-specification</docs><generator>niceopod's Firefox release notes RSS feed bridge</generator><ttl>$ttl</ttl><image><url>https://upload.wikimedia.org/wikipedia/commons/8/84/Mozilla_Firefox_3.5_logo.png</url><title>Firefox Release Notes</title><link>https://www.mozilla.org/firefox/releases/</link></image><item><title>Firefox $rel</title><pubDate>$date</pubDate><description>Release $rel of Firefox, from $origdate</description><link>$link</link><guid>$link</guid></item></channel></rss>"; + // Outputs an RSS feed with one entry. I wanted to do the latest ten, but the releases weren't in + // chronological order on the release list page and I couldn't be bothered trying to reorder them, + // plus I would have had to scrape all those pages for the release date too and fuck that lol + file_put_contents($fname, $output); +} else { + $output = file_get_contents($fname); +} + +header('Content-Type: text/xml'); // Not sure if this is necessary but it feels like good practice and it gets Chromium to display it all pretty +echo $output;
\ No newline at end of file diff --git a/stuff/index.php b/stuff/index.php new file mode 100644 index 0000000..89acd3b --- /dev/null +++ b/stuff/index.php @@ -0,0 +1,105 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Items</title> + <link href="../style.css" rel="stylesheet" type="text/css" media="all"> + <style> + details[open] > summary { + margin-bottom: .5rem; + } + details ul { + margin: 0; + padding-left: 1.5rem; + } + </style> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> + </head> + <body> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); bg(true, -15, "Pictured: The level of code quality you can expect if you use this stuff") ?> + <h1>stuff</h1> + <h2 id="caption">things too!</h2> + <h2>Utilities</h2> + <table> + <tr> + <td><a href="rssfilter.php">rssfilter.php</a></td> + <td>Basic RSS and Atom feed filtering utility. Accepts regex.</td> + </tr> + <tr> + <td><a href="firefoxrss/feed.php">firefoxrss</a></td> + <td>RSS bridge for Firefox release notes.</td> + </tr> + </table> + <h2>Downloads</h2> + <table> + <tr> + <td nowrap><a href="EnchantedToolsPack_v1.zip">EnchantedToolsPack_v1.zip</a></td> + <td>Custom resourcepack for Minecraft that uses functionality from <a href="https://optifine.net/home">Optifine</a> to add custom textures for enchanted tools and weapons. Confirmed working with 1.19.</td> + </tr> + </table> + <h2>Scripts</h2> + <table> + <tr> + <td>webpkiller/</td> + <td><details><summary>Automatic .webp converters</summary>Various scripts intended for use as the default program for opening .webp files. They automatically replace the .webp image with a .png one and open that instead. Incompatible with animated .webp images.</details></td> + </tr> + <tr class="indent-1"> + <td><a href="webpkiller/webpkiller.sh">webpkiller.sh</a></td> + <td> + <details> + <summary>Bash script for Linux.</summary> + <ul> + <li>Only works on .webp files.</li> + <li>Requires <a href="https://imagemagick.org/">ImageMagick</a> to be installed.</li> + </ul> + </details> + </td> + </tr> + <tr class="indent-1"> + <td><a href="webpkiller/webpkiller.cmd">webpkiller.cmd</a></td> + <td> + <details> + <summary>Batch script for Windows.</summary> + <ul> + <li>Only works on .webp files.</li> + <li>Requires <a href="https://imagemagick.org/">ImageMagick</a>.</li> + <li>Replaces <i>every</i> instance of ".webp" in the filepath because Windows batch language is hard.</li> + </ul> + </details> + </td> + </tr> + <tr class="indent-1"> + <td><a href="webpkiller/webpkiller.py">webpkiller.py</a></td> + <td> + <details> + <summary>Platform-agnostic Python script.</summary> + <ul> + <li>Works on anything supported by pillow.</li> + <li>Requires <a href="https://www.python.org/">Python 3</a> and the <a href="https://python-pillow.org/">pillow</a> library.</li> + </ul> + </details> + </td> + </tr> + <tr class="indent-1"> + <td><a href="webpkiller/webpkiller_win.zip">webpkiller_win.zip</a></td> + <td><details><summary>Windows webpkiller.py build.</summary>webpkiller.py, but compiled for Windows with <a href="https://pypi.org/project/pyinstaller/">pyinstaller</a>.</td> + </tr> + <tr> + <td><a href="dirtomp3.sh">dirtomp3.sh</a></td> + <td>Bash script that uses ffmpeg to convert a music library to mp3s.</td> + </tr> + </table> + <h2>Other</h2> + <table> + <tr> + <td><a href="neon_boost_times.html">neon_boost_times.html</a></td> + <td>A table of my level times in Neon Boost.</td> + </tr> + <tr> + <td><a href="https://userstyles.world/style/5238/status-cafe-latte">userstyles.world/style/5238<br/>/status-cafe-latte</a></td> + <td>Stylus theme I made for <a href="https://status.cafe/">status.cafe</a> and the attached forum.</td> + </tr> + </table> + </body> +</html> diff --git a/stuff/neon_boost_times.html b/stuff/neon_boost_times.html new file mode 100644 index 0000000..e00af8c --- /dev/null +++ b/stuff/neon_boost_times.html @@ -0,0 +1,103 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>My level times in Neon Boost</title> + <style type="text/css"> + html, body { + height: 100%; + overflow-y: hidden; + } + body { + font-family: 'Orbitron', sans-serif; + font-size: 1.2em; + display: flex; + justify-content: center; + align-items: center; + background-image: linear-gradient(#5d0081 2px, transparent 2px), linear-gradient(to right, #5d0081 2px, transparent 2px); + background-size: 150px 150px; + background-color: #000000; + background-repeat: repeat; + animation-name: bganim; + animation-duration: 6s; + animation-iteration-count: infinite; + animation-timing-function: linear; + margin: 0; + } + @keyframes bganim { + 0% { background-position: 0px 0px; } + 100% { background-position: 150px 150px; } + } + div#main { + border: 5px solid #f82a6a; + padding: 35px; + color: #0dff00; + background-image: repeating-linear-gradient(0deg, #041c07, #041c07 3px, transparent 3px, transparent); + background-size: 6px 6px; + background-color: #041807; + box-shadow: 0 0 30px #c21a4fdc inset, 0 0 100px 100px black inset, 0 0 30px #c21a4fee; + max-width: 95%; + box-sizing: border-box; + } + div#tablediv { + width: 100%; + overflow-x: scroll; + } + table { + width: 100%; + overflow-x: scroll; + } + td { + padding: 5px; + } + .highlighted { + background-color: #eeffee0c; + } + p { + margin-bottom: 0; + font-size: 0.8em; + } + a { + color: #f82a6a; + text-decoration: none; + } + .c0 { + color: gold; + } + </style> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap" rel="stylesheet"> + </head> + <body> + <div id="main"> + <div id="tablediv"> + <table> + <tr> + <td>Level</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td> + </tr> + <tr class="highlighted"> + <td>Laser City</td><td class="c0">4.219</td><td class="c0">3.939</td><td>3.899</td><td>6.359</td><td class="c0">3.959</td><td class="c0">3.259</td><td>6.139</td><td>7.159</td><td>2.419</td><td>8.32</td><td class="c0">5.419</td><td class="c0">17</td> + </tr> + <tr> + <td>Laser City<br/>(Lights Off)</td><td class="c0">4.439</td><td class="c0">4.119</td><td>4.179</td><td>7.079</td><td class="c0">5.799</td><td class="c0">3.419</td><td>5.859</td><td>7.299</td><td>2.519</td><td>8.46</td><td class="c0">5.859</td><td>20.02</td> + </tr> + <tr class="highlighted"> + <td>Tesla Factory</td><td>3.999</td><td>5.219</td><td>6.359</td><td>3.359</td><td>5.959</td><td>4.719</td><td>6.839</td><td>1.999</td><td>6.259</td><td>4.779</td><td class="c0">7.219</td><td class="c0">16.44</td> + </tr> + <tr> + <td>Tesla Factory<br/>(Lights Off)</td><td>4.159</td><td>5.679</td><td>6.519</td><td>3.619</td><td>5.719</td><td>5.639</td><td>6.799</td><td>2.039</td><td>6.319</td><td>5.519</td><td class="c0">7.019</td><td class="c0">16.92</td> + </tr> + <tr class="highlighted"> + <td>Cosmic Highway</td><td>9.14</td><td>6.279</td><td>6.979</td><td>11.02</td><td>5.439</td><td>9.58</td><td>7.199</td><td>11.24</td><td>17.8</td><td>4.679</td><td>25.06</td><td>40.78</td> + </tr> + <tr> + <td nowrap>Cosmic Highway<br/>(Lights Off)</td><td>10.46</td><td>6.699</td><td>6.859</td><td>12.8</td><td>5.779</td><td>10.32</td><td>7.839</td><td>13.28</td><td>19.02</td><td>4.779</td><td>29.36</td><td>42.56</td> + </tr> + </table> + </div> + <p>Times are in seconds, truncated to the millisecond because the in-game timer is rife with rounding errors.<br/>Times in <span class="c0">yellow</span> are from levels I can effectively "skip", or beat without triggering the timer to start.<br/>Read the blog post I made this for <a href="https://isopod.cool/old/2/?page=blog#Second">here</a>. Get Neon Boost <a href="https://store.steampowered.com/app/1057850/Neon_Boost/">here</a>.</p> + </div> + </body> +</html>
\ No newline at end of file diff --git a/stuff/rssfilter.php b/stuff/rssfilter.php new file mode 100644 index 0000000..ea749cd --- /dev/null +++ b/stuff/rssfilter.php @@ -0,0 +1,288 @@ +<?php + +// Here's my embarrassing ass source code. It is public domain, do with it what you will + +/*ini_set('display_errors', 1); +ini_set('display_startup_errors', 1); +error_reporting(E_ALL);*/ + +if($_GET['downloadsource'] == 'yes') { // just serve the source code as plain text and exit + header('Content-Type: text/plain'); + echo file_get_contents('rssfilter.php'); + die(); +} + +$feed = $_GET['feed']; +$filter = $_GET['filter']; +$filtertype = $_GET['type']; +$useregex = false; +if($_GET['regex'] == 'yes' or $_GET['regex'] == 'y') { + $useregex = true; +} + +function rss_testforfilter($item) { // I wrote two different functions for filtering RSS and Atom feeds under the assumption that they would be radically different + // in some way. The only real difference ended up being how the categories are stored within the category tags. I could probably + // consolidate them into one function, but these boolean expressions are big and complicated and I'm too scared to touch it now. + + global $useregex; // PHP is silly and makes you re-declare global variables if you want to use them inside functions. + global $filter; + foreach($item->category as $category) { // loops through all the <category> tags and returns true if any of them contain the filter string + if( + (!$useregex and strpos($category, $filter) !== false) or // Don't use regex and filter string is found + ($useregex and preg_match($filter, $category)) // DO use regex and filter expression is found + ) { + return true; + } + } + if( + (!$useregex and (strpos($item->description, $filter) !== false or strpos($item->title, $filter) !== false)) or // Don't use regex and filter string is found + ($useregex and (preg_match($filter, $item->description) or preg_match($filter, $item->title))) // DO use regex and filter expression is found + ) { + return true; + } + return false; +} + +function atom_testforfilter($entry) { + global $useregex; + global $filter; + foreach($entry->category as $category) { // loops through all the <category> tags and returns true if any of them contain the filter string + if( + (!$useregex and strpos($category['term'], $filter) !== false) or // Don't use regex and filter string is found + ($useregex and preg_match($filter, $category['term'])) // DO use regex and filter expression is found + ) { + return true; + } + } + if( + (!$useregex and (strpos($entry->description, $filter) !== false or strpos($entry->title, $filter) !== false)) or // Don't use regex and filter string is found + ($useregex and (preg_match($filter, $entry->description) or preg_match($filter, $entry->title))) // DO use regex and filter expression is found + ) { + return true; + } + return false; +} + +if($feed // A basic check to make sure the URL is formed properly. It doesn't actually check for a valid URL or valid regex. + and $filter // If this check fails, the HTML document below this gets served. + and ($filtertype === "white" or $filtertype === "black") +){ + header('Content-Type: text/xml'); // Not sure if I actually need to do this, but it seems like good practice and it makes Chromium display the XML tree all nice. + + $content = simplexml_load_string(file_get_contents($feed)); // I've encountered a problem where something between the server this command pulls from and this script seems to + // be caching the result. I'm guessing it's some kind of Nginx configuration error, but I'm not sure. Maybe I + // should be using a different function to do this? rss-bridge uses the cURL library, which I know because I had + // to install it myself. + + if($content->getName() == 'rss') { // Here I just assume everything not explicitly an RSS feed is an Atom feed. I am 100% certain there is an edge case I'm missing here. + + echo '<rss version="2.0"><channel>'; // This is the most embarrassing part of this code by far. I wanted to do this by looping over all the entries + echo $content->channel->title->asXML(); // in the XML object and specifically removing the ones that didn't pass the filter *from* the object, but + echo $content->channel->link->asXML(); // I couldn't for the life of me get that to work, so I settled for the next best thing: just echoing all the + echo $content->channel->description->asXML(); // fields that are part of the spec out to a brand new XML document and then adding all the entries that did + echo $content->channel->language->asXML(); // pass. I mean, if it works it works, but sorry to anyone that was using some nonstandard feature here. + echo $content->channel->pubDate->asXML(); + echo $content->channel->lastBuildDate->asXML(); + echo $content->channel->docs->asXML(); + echo "<generator>will's RSS filter script</generator>"; + echo $content->channel->managingEditor->asXML(); + echo $content->channel->webMaster->asXML(); + + foreach($content->channel->item as $item) { + + $found = rss_testforfilter($item, $filter); + + if(($found and $filtertype == 'white') or (!$found and $filtertype == 'black')) { + echo $item->asXML(); + } + + } + + echo '</channel></rss>'; + + die(); + } else { + + echo '<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom">'; + echo $content->title->asXML(); + echo $content->link->asXML(); + echo $content->updated->asXML(); + echo $content->author->asXML(); + echo $content->id->asXML(); + foreach($content->category as $category) { + echo $category->asXML(); + } + foreach($content->contributor as $contributor) { + echo $contributor->asXML(); + } + echo "<generator>will's Atom filter script</generator>"; + echo $content->icon->asXML(); + echo $content->logo->asXML(); + echo $content->rights->asXML(); + echo $content->subtitle->asXML(); + + foreach($content->entry as $entry) { + + $found = atom_testforfilter($entry, $filter); + + if(($found and $filtertype == 'white') or (!$found and $filtertype == 'black')) { + echo $entry->asXML(); + } + + } + + echo '</feed>'; + + die(); + } +} + +?> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>RSS Filter</title> + <style type="text/css"> + html, body { + margin: 0; + padding: 0; + height: 100%; + } + body { + margin: auto; + width: fit-content; + max-width: 32rem; + background-color: #222222; + font-family: monospace; + color: white; + display: flex; + align-items: center; + font-size: 1rem; + flex-direction: column; + justify-content: center; + text-shadow: 1px 1px 3px black; + } + td:first-child { + padding-right: 1em; + font-weight: bold; + } + input[type="text"] { + width: 100%; + } + code { + font-size: initial; + background-color: #101010; + padding: 1em; + border-radius: 1em; + display: block; + text-align: center; + margin: auto; + box-shadow: 2px 2px 4px black; + } + code span { + color: #ccc; + } + table { + font-size: 0.9rem; + } + a { + color: #df1955; + } + a:hover { + color: #00ffd5; + } + @media only screen and (orientation: portrait) { + td { + display: block; + padding-top: 0.5rem; + } + body { + max-width: 20rem; + } + } + </style> + </head> + <body> + <h1 style="margin: 0;">RSS Filter</h1> + <hr style="width: 30%; margin: 1.25rem;"> + <table> + <noscript> + <tr> + <td colspan="2">You need to have Javascript enabled for this generator to work, sorry.</td> + </tr> + </noscript> + <tr> + <td>Feed URL</td> + <td><input type="text" placeholder="https://example.com/rss" id="feed" value=""></input></td> + </tr> + <tr> + <td>Filter String</td> + <td><input type="text" placeholder="foobar" id="filter" value=""></input></td> + </tr> + <tr> + <td>Filter Type</td> + <td> + <input type="radio" id="whitelist" name="filtertype" value="white" checked> + <label for="whitelist">Whitelist</label> + <input type="radio" id="blacklist" name="filtertype" value="black"> + <label for="blacklist">Blacklist</label> + </td> + </tr> + <tr> + <td><label for="regex">Use Regex</label></td> + <td><input type="checkbox" id="regex"></td> + </tr> + </table> + <p> + <code><a id="generatedlink" href=""></a></code> + </p> + <p style="position: absolute; bottom: 1em; margin: 0; text-align: center;"> + Made by <a href="https://isopod.cool/">an isopod</a><br> + <a href="?downloadsource=yes">Download source code</a> + </p> + <script> + + let feedURL = "https://example.com/rss"; + let filter = "foobar"; + let type = "white"; + let regex = ""; + + function updateLink() { + let link = `${window.location.href}?feed=${feedURL}&filter=${filter}&type=${type}${regex}`; + document.getElementById('generatedlink').href = link; + document.getElementById('generatedlink').innerHTML = link.replace(/&/g, "&"); + } + + updateLink(); + + document.getElementById('feed').addEventListener('input', function(evt) { + feedURL = encodeURI(this.value); + updateLink(); + }); + document.getElementById('filter').addEventListener('input', function(evt) { + filter = encodeURI(this.value); + updateLink(); + }); + document.getElementById('whitelist').addEventListener('input', function(evt) { + type = "white"; + updateLink(); + }); + document.getElementById('blacklist').addEventListener('input', function(evt) { + type = "black"; + updateLink(); + }); + document.getElementById('regex').addEventListener('change', function(evt) { + if(this.checked) { + regex = "®ex=yes"; + document.getElementById('filter').placeholder = "/foobar/"; + } else { + regex = ""; + document.getElementById('filter').placeholder = "foobar"; + } + updateLink(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/stuff/spotifycdnsilly/ip.php b/stuff/spotifycdnsilly/ip.php new file mode 100644 index 0000000..e8332ff --- /dev/null +++ b/stuff/spotifycdnsilly/ip.php @@ -0,0 +1,21 @@ +<?php + +$addr = $_SERVER['REMOTE_ADDR']; +$url = "https://seed-mix-image.spotifycdn.com/v6/img/desc/$addr/sv/large"; +$img = "<img src='$url' alt='Spotify: $addr'>"; + +?> + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title><?php echo($addr); ?></title> + <link href="/style.css" rel="stylesheet" type="text/css" media="all"> + <?php echo("<meta property='og:image' content='$url'>"); ?> + </head> + <body style="display: flex; align-items: center; justify-content: center;"> + <?php echo($img); ?> + </body> +</html> diff --git a/stuff/webgarden/image1.html b/stuff/webgarden/image1.html new file mode 100644 index 0000000..4c1d559 --- /dev/null +++ b/stuff/webgarden/image1.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Image1</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + a { + color: white; + text-decoration: none; + } + </style> + </head> + <body> + <div id="plant" style="background-image: url('images/image1.png');"> + <a id="back" href="index.php" style="font-size: 2em; position: absolute; left: 4px; top: 218px;"><</a> + <a id="forward" href="image2.html" style="font-size: 2em; position: absolute; left: 228px; top: 218px;">></a> + </div> + </body> +</html> diff --git a/stuff/webgarden/image2.html b/stuff/webgarden/image2.html new file mode 100644 index 0000000..3ac0aa5 --- /dev/null +++ b/stuff/webgarden/image2.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Image2</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + a { + color: white; + text-decoration: none; + } + </style> + </head> + <body> + <div id="plant" style="background-image: url('images/image2.png');"> + <a id="back" href="image1.html" style="font-size: 2em; position: absolute; left: 4px; top: 218px;"><</a> + <a id="forward" href="image3.html" style="font-size: 2em; position: absolute; left: 228px; top: 218px;">></a> + </div> + </body> +</html> diff --git a/stuff/webgarden/image3.html b/stuff/webgarden/image3.html new file mode 100644 index 0000000..00e8417 --- /dev/null +++ b/stuff/webgarden/image3.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Image3</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + a { + color: white; + text-decoration: none; + } + </style> + </head> + <body> + <div id="plant" style="background-image: url('images/image3.png');"> + <a id="back" href="image2.html" style="font-size: 2em; position: absolute; left: 4px; top: 218px;"><</a> + <a id="forward" href="image4.html" style="font-size: 2em; position: absolute; left: 228px; top: 218px;">></a> + </div> + </body> +</html> diff --git a/stuff/webgarden/image4.html b/stuff/webgarden/image4.html new file mode 100644 index 0000000..f2e2a77 --- /dev/null +++ b/stuff/webgarden/image4.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Image4</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + a { + color: white; + text-decoration: none; + } + </style> + </head> + <body> + <div id="plant" style="background-image: url('images/image4.png');"> + <a id="back" href="image3.html" style="font-size: 2em; position: absolute; left: 4px; top: 218px;"><</a> + <a id="forward" href="index.php" style="font-size: 2em; position: absolute; left: 228px; top: 218px;">></a> + </div> + </body> +</html> diff --git a/stuff/webgarden/images/bubblecolumn1.gif b/stuff/webgarden/images/bubblecolumn1.gif Binary files differnew file mode 100644 index 0000000..ad31eb1 --- /dev/null +++ b/stuff/webgarden/images/bubblecolumn1.gif diff --git a/stuff/webgarden/images/image1.png b/stuff/webgarden/images/image1.png Binary files differnew file mode 100644 index 0000000..825d878 --- /dev/null +++ b/stuff/webgarden/images/image1.png diff --git a/stuff/webgarden/images/image2.png b/stuff/webgarden/images/image2.png Binary files differnew file mode 100644 index 0000000..cd9e273 --- /dev/null +++ b/stuff/webgarden/images/image2.png diff --git a/stuff/webgarden/images/image3.png b/stuff/webgarden/images/image3.png Binary files differnew file mode 100644 index 0000000..9de4975 --- /dev/null +++ b/stuff/webgarden/images/image3.png diff --git a/stuff/webgarden/images/image4.png b/stuff/webgarden/images/image4.png Binary files differnew file mode 100644 index 0000000..3562e48 --- /dev/null +++ b/stuff/webgarden/images/image4.png diff --git a/stuff/webgarden/images/isopod_with_aviators_small.png b/stuff/webgarden/images/isopod_with_aviators_small.png Binary files differnew file mode 100644 index 0000000..27ae5b7 --- /dev/null +++ b/stuff/webgarden/images/isopod_with_aviators_small.png diff --git a/stuff/webgarden/images/webgarden-bg.png b/stuff/webgarden/images/webgarden-bg.png Binary files differnew file mode 100644 index 0000000..f6052e8 --- /dev/null +++ b/stuff/webgarden/images/webgarden-bg.png diff --git a/stuff/webgarden/index.php b/stuff/webgarden/index.php new file mode 100644 index 0000000..af88805 --- /dev/null +++ b/stuff/webgarden/index.php @@ -0,0 +1,192 @@ +<!DOCTYPE html> +<html lang="en"> + <?php + $captions = array( + 'bruh moment', + 'Try reloading!', + 'Supports VPNs', + 'I use arch btw', + 'MySite.html', + 'Over Construction', + 'Real isopod hours', + '[object Object]', + '* You found the [Moss]!', + 'Minceraft', + 'Isopod gaming', + 'Website of some girl', + 'your mom', + 'Badly programmed', + 'Oh, you know ;)', + 'assholes DNI', + 'swag', + '\'\'', + '<span class="minecraftsplash">Kind of dragon free!</span>', + 'your gay', + 'the fuck is a gender', + 'The Only Website', + 'đđˇđĒđŦđŦđŽđŧđŧđ˛đĢđĩđŽ!', + 'Follow me on Google+!', + '404: caption not found', + 'Web Ī compliant!', + 'cringe', + 'real life isopod', + 'holy fucking bingle', + 'crubge', + 'Tested in prod!', + 'pwetty epic B)', + 'Semi-modular!', + 'Did you know?', + 'shrimps is bugs', + 'Delicious!', + 'trnasgener', + 'Opinionated!', + 'Eurorack compatible!', + 'Hackable!', + 'HiDPI!', + '&mdash; addict', + '3D printed!', + 'Federated!', + 'Chitinous!', + 'is this a bedbuge?', + 'Now in HD!', + 'Water me!' + ); + $cap = $captions[array_rand($captions)]; + ?> + <head> + <meta charset="utf-8"> + <title>Pot</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + :root { + --top-header-gap: 90px; + --menuwidth: 140px; + } + html, body { + padding: 0; + margin: 0; + } + h1 { + width: 250px; + position: absolute; + top: var(--top-header-gap); + text-align: center; + } + h2 { + width: 238px; + position: absolute; + top: calc(34px + var(--top-header-gap)); + text-align: right; + font-size: 1.1em; + } + #mainmenu { + background: #222222; + transition-duration: 0.6s; + height: 250px; + width: var(--menuwidth); + position: absolute; + top: 0; + left: 250px; + z-index: 2; + box-shadow: 0 0 0 black; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + } + body:hover #mainmenu { + left: calc(250px - var(--menuwidth)); + box-shadow: 0 0 20px black; + } + a { + color: white; + } + #mainmenu a { + color: #df1955; + } + #mainmenu a:hover { + color: #00ffd5; + } + + .flipped { + display: inline-block; + transform: rotate(180deg); + } + .rainbowtext { + animation-name: rainbow-text; + animation-duration: 20s; + animation-iteration-count: infinite; + } + .blinking { + animation-name: opacityblink; + animation-duration: 2s; + animation-iteration-count: infinite; + } + .minecraftsplash { + animation-name: growshrink; + animation-duration: 1.5s; + animation-iteration-count: infinite; + color: yellow; + display: inline-block; + } + + @keyframes growshrink { + 0%, 100% { transform: scale(1) /*rotate(-10deg)*/; } + 50% { transform: scale(1.2) /*rotate(-10deg)*/; } + } + @keyframes opacityblink { + 0%, 50% {opacity: 0;} + 50.001%, 100% {opacity: 1;} + } + @keyframes rainbow-text { + 100%,0%{color: rgb(255,0,0); text-shadow: 0 0 4px rgb(216, 1, 1);} + 8%{color: rgb(255,127,0); text-shadow: 0 0 4px rgb(211, 105, 0);} + 16%{color: rgb(255,255,0); text-shadow: 0 0 4px rgb(214, 214, 0);} + 25%{color: rgb(127,255,0); text-shadow: 0 0 4px rgb(105, 211, 0);} + 33%{color: rgb(0,255,0); text-shadow: 0 0 4px rgb(0, 204, 0);} + 41%{color: rgb(0,255,127); text-shadow: 0 0 4px rgb(0, 209, 105);} + 50%{color: rgb(0,255,255); text-shadow: 0 0 4px rgb(0, 202, 202);} + 58%{color: rgb(0,127,255); text-shadow: 0 0 4px rgb(0, 103, 206);} + 66%{color: rgb(0,0,255); text-shadow: 0 0 4px rgb(0, 0, 206);} + 75%{color: rgb(127,0,255); text-shadow: 0 0 4px rgb(103, 0, 206);} + 83%{color: rgb(255,0,255); text-shadow: 0 0 4px rgb(211, 0, 211);} + 91%{color: rgb(255,0,127); text-shadow: 0 0 4px rgb(211, 0, 105);} + } + @keyframes arrowwiggle { + 0%,90%,100% {left: 235px;} + 92% {left: 231px;} + } + audio { + display: none; + } + #mus:checked ~ audio { + display: initial; + } + </style> + </head> + <body> + <a target="_blank" href="../../"> + <div id="plant" style="background: url('images/webgarden-bg.png');"> + <h1>isopod.cool</h1> + <h2><?php echo $cap; ?></h2> + <img src="../../images/autoisopod_small.png" style="width: 70px; position: absolute; transform: scaleX(-1) rotate(-30deg); top: 188px; left: 170px;" /> + <img src="images/bubblecolumn1.gif" style="height: 250px; position: absolute; left: 20px; top: 0;" /> + <span id="hoverme"><<span> + </div> + </a> + <input type="checkbox" id="mus" name="mus" style="display: none;"></input> + <div id="mainmenu"> + <a target="_blank" href="../../">homepage</a> + <!--a target="_blank" href="../../desktop.html">$login<span class="blinking">_</span></a--> + <hr style="width: 30px;"> + <a href="image1.html">images</a> + <a href="status.php">status</a> + <label for="mus"><a style="text-decoration: underline; cursor: pointer;">play music</a></label> + <hr style="width: 30px;"> + <iframe src="https://isopod.cool/stuff/beat/frame.php?theme=pixel" style="width: 84px; height: 27px;"></iframe> + <img src="/etc/buttons/isopodhours.png" alt="isopod hours"/> + <img src="/etc/buttons/trans.png" alt="nonbinary"/> + </div> + <audio controls style="position: absolute; width: calc(100% - 0.4rem); top: 0.2rem; left: 0.2rem; z-index: 5;"><source src="music.mp3" type="audio/mp3"></audio> + </body> +</html> diff --git a/stuff/webgarden/music.mp3 b/stuff/webgarden/music.mp3 Binary files differnew file mode 100644 index 0000000..12f0400 --- /dev/null +++ b/stuff/webgarden/music.mp3 diff --git a/stuff/webgarden/status.php b/stuff/webgarden/status.php new file mode 100644 index 0000000..4330d31 --- /dev/null +++ b/stuff/webgarden/status.php @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Status</title> + <link href="style.css" rel="stylesheet" type="text/css" media="all"> + <style type="text/css"> + body { + background: #222222; + } + #statuscafe a { + color: #df1955; + } + #statuscafe a:hover { + color: #00ffd5; + } + #statuscafe { + display: flex; + flex-direction: column; + position: absolute; + left: 10px; + top: 10px; + height: 230px; + width: 230px; + justify-content: center; + align-items: center; + } + #statuscafe-content { + margin-top: 10px; + } + </style> + </head> + <body> + <div id="plant"> + <?php + $username = "niceopod"; // Your username here! + $status_data = json_decode(file_get_contents("https://status.cafe/users/$username/status.json"), true); + $content = $status_data["content"]; + $face = $status_data["face"]; + $timeago = str_replace(" "," ",$status_data["timeAgo"]); + if(strlen($content) < 1) { + $content = "No status yet."; + } + echo "<div id='statuscafe'><div id='statuscafe-username'><a href='https://status.cafe/users/$username' target='_blank'>$username</a> $face $timeago</div><div id='statuscafe-content'>$content</div></div>"; + ?> + <a id="back" href="index.php" style="font-size: 2em; position: absolute; left: 4px; top: 218px;"><</a> + </div> + </body> +</html> diff --git a/stuff/webgarden/style.css b/stuff/webgarden/style.css new file mode 100644 index 0000000..13c5320 --- /dev/null +++ b/stuff/webgarden/style.css @@ -0,0 +1,54 @@ +@font-face { + font-family: 'Silkscreen'; + src: url('../fonts/slkscr.ttf'); +} +@font-face { + font-family: b612_mono; + src: url(stuff/fonts/B612_Mono/B612Mono-Regular.ttf); +} +@font-face { + font-family: b612_mono; + src: url(stuff/fonts/B612_Mono/B612Mono-Bold.ttf); + font-weight: bold; +} +@font-face { + font-family: b612_mono; + src: url(stuff/fonts/B612_Mono/B612Mono-Italic.ttf); + font-style: italic; +} +@font-face { + font-family: b612_mono; + src: url(stuff/fonts/B612_Mono/B612Mono-BoldItalic.ttf); + font-weight: bold; + font-style: italic; +} +html, body { + margin: 0; + padding: 0; + overflow: hidden; +} +body { + font-family: b612_mono, mono, monospace; + color: white; + background: #101010; + text-shadow: 1px 1px 4px black; +} +#plant { + height: 250px; + width: 250px; +} +a#forward, a#back, h1, h2, #hoverme { + font-family: 'Silkscreen'; + color: white; + text-decoration: none; +} +#hoverme { + position: absolute; + top: 4px; + left: 235px; + animation-name: arrowwiggle; + animation-duration: 6s; + animation-iteration-count: infinite; + width: fit-content; + text-align: right; +}
\ No newline at end of file diff --git a/stuff/webpkiller/webpkiller.cmd b/stuff/webpkiller/webpkiller.cmd new file mode 100644 index 0000000..382e048 --- /dev/null +++ b/stuff/webpkiller/webpkiller.cmd @@ -0,0 +1,31 @@ +@echo off + +::Set variable filepath to the first argument +SET filepath=%~f1 + +::Abort if the given file doesn't exist +IF NOT EXIST "%filepath%" ( + ECHO %~n0: file not found - %filepath% >&2 + EXIT /B 1 +) + +::Replace all instances of .webp with .png in the filename. kind of banking on the user not putting the extension anywhere else in the file or folder names for this to work properly... +::I should be finding the last period in the filename and replacing everything AFTER it with the extension I want, but can't figure out how to do that because Windows batch is a nightmare language +::You can replace this with "SET outfile=%filepath%.png" (no quotes) if that bothers you more than double file extensions +::You can replace these two file extensions with any two image types you want to do this with +SET outfile=%filepath:.webp=.png% + +::Abort if filename.png already exists +IF EXIST "%outfile%" ( + ECHO %~n0: %outfile% already exists. Aborting... + EXIT /B 2 +) + +::Use ImageMagick's command line tools to generate the converted file +magick "%filepath%" "%outfile%" + +::Delete the original file (optional, this can be removed if for some reason you want to keep the shitty gross webp) +del "%filepath%" + +::Open the new, fixed image like nothing ever happened +%outfile% diff --git a/stuff/webpkiller/webpkiller.py b/stuff/webpkiller/webpkiller.py new file mode 100644 index 0000000..0153ff7 --- /dev/null +++ b/stuff/webpkiller/webpkiller.py @@ -0,0 +1,27 @@ +import PIL as pillow +from PIL import Image +import subprocess, os, platform, sys + +infile = sys.argv[len(sys.argv)-1] +outfile = infile[:infile.rfind('.')] + ".png" + +if(os.path.exists(infile) == False): + print("File %s not found. Aborting..." %infile) + exit() + +if(os.path.exists(outfile)): + print("File %s already exists. Aborting..." %outfile) + exit() + +im = Image.open(infile) + +im.save(outfile) + +os.remove(infile) + +if(platform.system() == 'Darwin'): # macOS + subprocess.call(('open', outfile)) +elif(platform.system() == 'Windows'): # Windows + os.startfile(outfile) +else: # linux variants + subprocess.call(('xdg-open', outfile))
\ No newline at end of file diff --git a/stuff/webpkiller/webpkiller.sh b/stuff/webpkiller/webpkiller.sh new file mode 100644 index 0000000..017fba0 --- /dev/null +++ b/stuff/webpkiller/webpkiller.sh @@ -0,0 +1,20 @@ +#!/bin/bash +if [ ! -f "$1" ]; then + echo "File $1 does not exist. Aborting..." + exit +fi + +suffix=".webp" +filename=${1%"$suffix"} +outfile="$filename.png" + +if [ -f "$outfile" ]; then + echo "File $outfile already exists. Aborting..." + notify-send --app-name=webpkiller "File $outfile already exists. Aborting..." + exit +fi + +magick $1 $outfile +rm -rf $1 + +xdg-open $outfile diff --git a/stuff/webpkiller/webpkiller_win.zip b/stuff/webpkiller/webpkiller_win.zip Binary files differnew file mode 100644 index 0000000..5d54054 --- /dev/null +++ b/stuff/webpkiller/webpkiller_win.zip |
