rozhlas.cz is one of the many independent Mastodon servers you can use to participate in the fediverse.
Server pro novinářky a novináře Českého rozhlasu.

Administered by:

Server stats:

3
active users

#tip

3 posts2 participants0 posts today

PHP tip

array_map('unlink', glob(CACHE . DS . '*.tmp') ?: []);

This code snippet provides a robust and efficient way to delete temp files from a cache directory. It leverages the power of glob(), array_map(), and the null coalescing operator to ensure that the deletion process is reliable and handles various scenarios.

You know you can use your mouse and keyboard between different Macs using Universal Control and copy/paste between them (which makes it really easy when manually migrating settings, etc., between machines), but did you know you can also copy/paste whole files using Terminal:

On the first Mac:

cat my-file.txt | pbcopy

On the second Mac:

pbpaste > my-file.txt

Piping to pbcopy is something you’ll likely find useful in general.

(You can also drag/drop files to Finder.)

Ano, Mastodon sice neumí citace tůtů, ale fskutečnosti je umí, protože přece všichni rychle přijdou na to, že lze snadno nasdílet URL tůtu na jiné instanci (dokonce i na jiné platformě). Sice se tady neembedne do timeline, ale lze ho snadno prokliknout a ...

Snažně vás prosím, pokud pro to neexistuje fakt dobrý důvod - nedělejte ho. Na tom Twitteru šlo alespoň snadno favnout, retweetnout či komentovat ten citovaný twít, potože šlo o jednu a tu samou platformu. Tady to je zbytečně pracné a zdržuje to: musím nakopírovat URL toho rozkliknutého tůtu do search boxu své instance a pak teprve můžu favovat, boostovat, komentovat.

Ano, každý by radši, aby se následně šířil ve Fediverse JEHO vlastní tůt (status), s jeho komentářem a URL komentovaného. Ale takhle to není ve Fediverse zamýšleno. Je to v naprosté většině případů nefér pro autora původního tůtu a ochuzuje ho to o favy, boosty a komentáře pod jeho původním tůtem!

Pokud chcete komentovat tůt, tak PROSÍM, komentujte ho přímo pod tím tůtem a neochuzujte tak autora o zpětnou vazbu.

(jeden z důvodů, proč bych preferoval embedování "citovaných" tůtů je právě to, aby mi to ušetřilo ten copy+paste manévr nutný otevření citovaného tůtu a zapojení své odpovědi do správného vlákna.. chci interagovat s autorem, ne s tím, kdo autora cituje!)

This is a very neat trick to unset max-height when an HTML element with resize='vertical' set in CSS is resized. So you can have elements initially displayed with a max-height but then resized beyond it:

stackoverflow.com/a/60286469

(Should work as is for resize='block' and with the selector tweaked to use "width" for horizontal/inline.)

Stack OverflowAllow resize to ignore max-height?I have some code like the first snippet - I am curious if there is a way to use resize and allow it to ignore max-height? The reason I don't just use height is I want the div to fit the first piec...
#web#dev#tip

Little web dev tip: if you have just one address field in your HTML form (e.g., a textarea) but you still want the person filling it in to avail themselves of autocomplete, here’s a little reusable snippet you can use to achieve that:

codeberg.org/aral/gists/src/br

(Ideally the web spec should be extended to include a full-address value for the autocomplete attribute.)

Codeberg.orggists/single-html-address-field-with-autocomplete-using-javascript.md at maingists - A place for me to post and share small, self-contained code snippets.

Hey everyone just FYI you can post to Kbin and Lemmy from Mastodon and other Fediverse Micro-blogging platforms by having one line of your post at the top be the title and putting a mention to the specific community's handle in your post, works best if the mention is below the title. Also you can even attach images and they will appear in the post as an image (multiple images don't work as well sadly).

You can find communities to post in on lemmyverse.net/communities

Here's an example of the format that works best, even for non-glitch instances:


[Post title text]

*(separate title and body with blank space)

[Post body text]

[Community's handle mention]

#feditips#tips#tip

Tip, if you ever need it: take a lot of photos of your house for insurance/disaster reasons. More than you think you need. Of all the random details of stuff -- where shelves are, what your drawers look like, what pictures you have on the walls. Having just gone through a remodel due to a plumbing disaster, there are a lot of places I had wished I had photos of (ie the laundry room cabinets, the inside of the kitchen cabinets!) #disaster #tip #disasterpreparation #insurance #disasterprep

If you’re a web developer using Vivaldi, first thing you should do is go to Menu → Settings → Appearance and, under the Menu section, select Page from the Menu Customization dropdown then right-click on [Developer Tools] under Content and deselect Show as Subfolder.

You’re welcome 🤓👍

Update: You have to do this manually for *every item* in the Menu section. That’s Audio and Video, Image, Link, Selection, and Text Field in order to have the Inspect item top-level.

#vivaldi#web#dev