1
0
Fork 0

Things I Keep Having To Google blog post + Flatworm Friday

Full list of changes:
- Added new blog post, "Guide - Things I Keep Having To Google"
- Landing page now has a 1 in 10 chance to display a flatworm friday video on friday
- Added CSS for tables to highlight alternating rows with a certain class
- Landing page captions now include the current Swatch Internet Time
- Testing feature where the ?caption url parameter, if present, is put through the caption generator function instead of an array selection
- Updated changelog
This commit is contained in:
will 2023-01-12 05:38:38 -07:00
parent daf027645e
commit 1d770f020d
6 changed files with 74 additions and 5 deletions

View file

@ -67,6 +67,8 @@
echo "<div id='statuscafe'><div id='statuscafe-username'><a href='https://status.cafe/users/$username' target='_blank'>status</a> $face $timeago</div><div id='statuscafe-content'>$content</div></div>";
?>
<ul>
<li><h2>2023</h2></li>
<li><time datetime="2023-01-12 5:37">2023-01-12</time> <a href="posts/guide_things_i_keep_having_to_google/">Guide - Things I Keep Having To Google</a></li>
<li><h2>2022</h2></li>
<li><time datetime="2022-09-19 1:18">2022-09-19</time> <a href="posts/deeptwistycom_2nd_anniversary_-_a_history_of_this_bullshit/">deeptwisty.com 2nd anniversary - A History of This Bullshit</a></li>
<li><time datetime="2022-08-25 8:04">2022-08-25</time> <a href="posts/guide_self_host_safely_with_wireguard/">Guide - Self-Host Safely with WireGuard</a></li>

View file

@ -64,7 +64,45 @@
<tr><td colspan="2"><h4>xrandr</h4></td></tr>
<tr><td><code>xrandr --output &lt;display name&gt; --brightness &lt;brightness&gt;</code></td><td title="It would definitely for sure be better to change this via the monitor's built-in menus, but that requires navigating both of my monitors' built-in menus.">Janky software-side display brightness setting</td></tr>
</table>
<h2>HTML/CSS stuff</h2>
<p>Force a <code>&lt;td&gt;</code> element not to wrap by adding the <code>nowrap</code> attribute to it.</p>
<h2>Webdev stuff</h2>
<h4>Tables</h4>
<ul>
<li>Force a <code>&lt;td&gt;</code> element not to wrap by adding the <code>nowrap</code> attribute to it.</li>
<li>Set the <code>table-layout</code> CSS property to <code>fixed</code> to force the the columns to be equal widths.</li>
</ul>
<h4>PHP</h4>
<ul>
<li>The <code>date()</code> function in PHP returns date information. The first argument is a format string and the second is an optional integer for a Unix timestamp. The valid format characters as of PHP 8 can be found <a href="https://www.php.net/manual/en/datetime.format.php">here</a>, and examples are listed in this table:</p>
<details>
<summary>Show table</summary><br>
It is currently <?php echo date('l, F j, Y \a\t g:i:s A T');?><br><br>
<table class="highlightrows" style="table-layout: fixed; width: 100%;">
<tr style="font-weight: bold;"><td>Character</td><td>Output</td><td>Character</td><td>Output</td></tr>
<tr><td>Y</td><td><?php echo date("Y");?></td><td>y</td><td><?php echo date("y");?></td></tr>
<tr><td>o</td><td><?php echo date("o");?></td><td>L</td><td><?php echo date("L");?></td></tr>
<tr><td>F</td><td><?php echo date("F");?></td><td>M</td><td><?php echo date("M");?></td></tr>
<tr><td>m</td><td><?php echo date("m");?></td><td>n</td><td><?php echo date("n");?></td></tr>
<tr><td>t</td><td><?php echo date("t");?></td><td>W</td><td><?php echo date("W");?></td></tr>
<tr><td>l</td><td><?php echo date("l");?></td><td>D</td><td><?php echo date("D");?></td></tr>
<tr><td>d</td><td><?php echo date("d");?></td><td>j</td><td><?php echo date("j");?></td></tr>
<tr><td>S</td><td><?php echo date("S");?></td><td>z</td><td><?php echo date("z");?></td></tr>
<tr><td>N</td><td><?php echo date("N");?></td><td>w</td><td><?php echo date("w");?></td></tr>
<tr><td>A</td><td><?php echo date("A");?></td><td>a</td><td><?php echo date("a");?></td></tr>
<tr><td>g</td><td><?php echo date("g");?></td><td>G</td><td><?php echo date("G");?></td></tr>
<tr><td>h</td><td><?php echo date("h");?></td><td>H</td><td><?php echo date("H");?></td></tr>
<tr><td>i</td><td><?php echo date("i");?></td><td>s</td><td><?php echo date("s");?></td></tr>
<tr title="These are milliseconds and microseconds respectively. They will both return 0 when used with date() as it takes the Unix timestamp as an integer in seconds, but there are other functions that take this formatting and will return these accurately."><td>v</td><td><?php echo date("v");?></td><td>u</td><td><?php echo date("u");?></td></tr>
<tr><td title="This one is so funny to me. This is Swatch Internet Time, a time system created in 1998 by the Swatch corporation to promote their &quot;Beat&quot; watches. It divides the day into 1000 equal chunks 86.4 seconds long. I encourage you to go read the Wikipedia page for this thing. It's great. Why PHP has a function for it I have no idea.">B</td><td><?php echo date("B");?></td><td>I</td><td><?php echo date("I");?></td></tr>
<tr><td>e</td><td><?php echo date("e");?></td><td>O</td><td><?php echo date("O");?></td></tr>
<tr><td>P</td><td><?php echo date("P");?><td>Z</td><td><?php echo date("Z");?></td></tr>
<tr><td title="You can also use the function time() for this.">U</td><td colspan="3"><?php echo date("U");?></td></tr>
<tr><td>c</td><td colspan="3"><?php echo date("c");?></td></tr>
<tr><td>r</td><td colspan="3"><?php echo date("r");?></td></tr>
</table>
</details><br>
The <code>strtotime()</code> function does the reverse operation, converting date strings to Unix timestamps. Storing dates as Unix timestamps and converting when needed is recommended.</li>
</ul>
<h2>Song Lyrics</h2>
<p>I don't actually have a solution for this one, I just wish there was a resource for looking up the lyrics to songs and looking up songs by their lyrics that wasn't an SEO leech site.</p>
</body>
</html>

View file

@ -22,6 +22,15 @@
<body style="background: none;">
<h1>isopod.cool changelog</h1>
<article>
<h2>2023-1-12</h2>
<ul>
<li>New <a target="_blank" href="../blog/posts/guide_things_i_keep_having_to_google">blog post</a>!
<ul><li>This one's more of a reference than an article, so it will likely be updated as time goes on.</li></ul>
</li>
<li>Added flatworm friday</li>
</ul>
</article>
<article>
<h2>2023-1-05</h2>
<ul>

View file

@ -59,7 +59,7 @@
<img src="buttons/canadian.gif" title="Regrettably...">
<img src="buttons/queercoded.png">
<img src="buttons/aro.png">
<img src="buttons/ace.png">
<!--img src="buttons/ace.png"-->
<a href="https://rainy.gay/pride/pridebuttons.html"><img src="buttons/nonbinary.png"></a>
<br /><a target="_blank" href="https://citrons.xyz/a/memetic-apioform-page.html"
style="display: inline-block; margin-top: .7rem;"><img src="images/apiopage.png" /></a>

View file

@ -34,7 +34,7 @@
</style>
<?php
include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php');
if(!preg_match('/(headlesschrome)/i', $_SERVER['HTTP_USER_AGENT'])) {
if(!preg_match('/(headless.*)/i', $_SERVER['HTTP_USER_AGENT'])) {
$captions = array();
$seasonal = false;
switch(date('m')) {
@ -118,11 +118,15 @@
'PLACEHIM',
'UPSIDEDOWN',
'RGB',
'BLAHAJ'
'BLAHAJ',
'@BEAT'
);
break;
}
$cap = $captions[array_rand($captions)];
if($_GET['caption']) {
$cap = $_GET['caption'];
}
$tit = $cap;
if(!$seasonal) {
switch($cap) {
@ -166,6 +170,9 @@
$cap = '<span class="rainbowtext">RGB Gaming Webpage</span>';
$tit = 'RGB Gaming Webpage';
break;
case '@BEAT':
$cap = '@'.date("B");
break;
}
}
}
@ -196,5 +203,12 @@
<div id="rightsidebg" style="background-image: url(images/bg.png); --distancefromcenter: 11%;" title="Pictured: The eponymous &quot;deep twisty&quot;"></div>
<div id="bubblecolumn"></div>
<?php include('chromealert.php'); ?>
<?php
if(date("w") == "5" && rand(0, 9) == 4) {
$ind = rand(1,2);
$filename = "images/flatworm friday $ind.mp4";
echo "<div id='flatwormfriday' style='position: absolute;left: 0;right: 0;top: 0;bottom: 0;background: #000000cc;display: flex;justify-content: center;align-items: center;'><video controls=''><source src='$filename' type='video/mp4'>It's Flatworm Friday! Your browser does not support the video tag.</video></div>";
}
?>
</body>
</html>

View file

@ -149,6 +149,12 @@ main > code, body > code {
tr:hover {
background-color: #2222227c;
}
table.highlightrows tr:nth-child(2n+1) {
background-color: #ffffff11;
}
table.highlightrows tr:nth-child(2n+1):hover {
background-color: #ffffff11;
}
@media(max-width: 650px) {
body {