- I got "Baldur's Gate: Enhanced Edition" from Amazon Games.
- I have a 4K screen on my laptop
- Baldur's Gate: Enhanced Edition is tiny in the middle of the screen
The game doesn't have an Options screen that I can use.
<?php | |
declare(strict_types=1); | |
namespace App\Shared; | |
use Illuminate\Support\Facades\DB; | |
/* | |
I couldn't find a clean way to extend Laravel's Query Builder, so this will have to do. | |
Reason for this file's existence: I'm tired of writing `addcslashes` everywhere I use the `LIKE` operator. |
<?php | |
/* | |
References: | |
* https://security.stackexchange.com/questions/9908/multibyte-character-exploits-php-mysql | |
* https://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string | |
* https://stackoverflow.com/questions/17992893/how-can-i-get-the-single-bytes-from-a-multibyte-php-string-variable-in-a-binary | |
* https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt | |
* Related reading, but not using UTF-8: https://shiflett.org/blog/2006/addslashes-versus-mysql-real-escape-string | |
*/ |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
) |
The Motorola Moto G10 is very sluggish on Android 11 (the latest Android available for it) due to its low-end CPU, low RAM (4GB), and what feels like slow flash storage.
The most annoying point is that I can't answer phone calls in a timely manner. It takes about 10 seconds for it to load all the code that can handle the "Answer" button.
I otherwise quite like its battery life, and don't miss the features of a flagship.
But I did manage to make it more usable using the Developer Options:
<?php | |
// File path in Laravel project: `tests/RefreshTheDamnedDatabase.php` | |
declare(strict_types=1); | |
namespace Tests; | |
/** | |
* Quick and dirty database refresh for tests |
#!/bin/zsh | |
## This function exists because on a Mac the `realpath` program doesn't have a `--relative-to` option like GNU does. | |
## This file can both be used as a standalone command and as a sourced file to use in other scripts. | |
relativepath() | |
{ | |
local RelativeTo=$1 Path=$2 | |
if [[ $RelativeTo != /* || $Path != /* ]]; then |
// this is an "abstract class" pattern for Javascript | |
/* | |
extend `AbstractClass` (meta-class?) to declare your class abstract | |
define an `abstractMethods()` method in your abstract class to declare which methods child classes must implement | |
extend your abstract class as normal | |
*/ | |
// the `AbstractClass` meta-class | |
class AbstractClass { |
// Ext4 leaves metadata allocated for directories when files are deleted. | |
// That isn't usually a problem, as that allocation is reused when new files are created. | |
// But if you leave lots of abandonded empty directories around, they can slowly eat up disk space. | |
// Note on "slowly": "very slowly". On my system (8 cores, nvme drive), it takes aproximately 10s per iteration. | |
// 100 iteration take 15-20 minutes. | |
// This program creates 200K small files, and then deletes them, after which it repeats the process in a new directory. | |
// By default, it loops 100 times using the `output_files` directory. | |
// If you run `du -h` on a directory that has undergone this process, you'll see that it takes a few megabyets of space. |