Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
// MyType is a generic that we can pass different types when calling handleAsyncTask() | |
const handleAsyncTask = async function<MyType> (asyncFn: () => Promise<MyType | string>) : Promise<[boolean, MyType | undefined]> { | |
const result = await asyncFn(); | |
if (typeof result === 'string') { | |
return [true, undefined]; | |
} | |
return [false, result]; | |
} |
This bookmarklet shows a profile or a post on another Mastodon server in your server’s web app.
HOST
to the domain of your Mastodon server.show-in-mastodon-web-app.js
into its address (browsers are OK with pasting multiple lines).#!/bin/bash | |
set -e | |
# dependencies: | |
# - youtube-dl: https://ytdl-org.github.io/youtube-dl/ | |
# - ffmpeg: https://ffmpeg.org/ | |
# make sure youtube-dl dep exists | |
if ! command -v youtube-dl &> /dev/null | |
then |
https://naturalearth.s3.amazonaws.com/10m_cultural/ https://naturalearth.s3.amazonaws.com/10m_cultural/10m_cultural.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_antarctic_claim_limit_lines.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_antarctic_claims.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_boundary_lines_disputed_areas.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_boundary_lines_land.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_boundary_lines_map_units.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_boundary_lines_maritime_indicator.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_countries.zip https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_countries_lakes.zip
Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.
don't upload a video file, they will re-encode it into absolute 💩
create a GIF, which they will auto-convert into a video file 😱
The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,
ffmpeg -ss $INPUT_START_TIME -t $LENGTH -i $INPUT_FILENAME \ | |
-vf "fps=$OUTPUT_FPS,scale=$OUTPUT_WIDTH:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
-loop $NUMBER_OF_LOOPS $OUTPUT_FILENAME | |
# Change these placeholders: | |
# * $INPUT_START_TIME - number of seconds in the input video to start from. | |
# * $LENGTH - number of seconds to convert from the input video. | |
# * $INPUT_FILENAME - path to the input video. | |
# * $OUTPUT_FPS - ouput frames per second. Start with `10`. | |
# * $OUTPUT_WIDTH - output width in pixels. Aspect ratio is maintained. |
Find the full post on fotis.xyz
:focus-visible is a standard way of only showing focus styles for keyboard and focus-based modalities. When using it, however, you must take care to not remove :focus altogether, where :focus-visible is not supported.
With CSS, we can achieve progressive enhancement of :focus to :focus-visible:
/* Styles where only focus is supported */
button:focus,