slacle, to genart
@slacle@mastodon.social avatar
siblingpastry, (edited ) to keyboard
@siblingpastry@mastodon.world avatar

I've been playing around with keyboard scrolling of overflow regions, and I was interested to note how Firefox's native behavior doesn't expose any additional semantics -- i.e., it doesn't apply a role or accessible name when the scrolling region becomes focusable.

And I think that's the right thing to do -- that our standard workaround of including role="region" and aria-label or aria-labelledby (along with tabindex="0") creates unnecessary verbosity.

(1/3)

siblingpastry, (edited )
@siblingpastry@mastodon.world avatar

I've created a demo script on that basis, which doesn't add a role or label, it simply adds or removes tabindex based on whether the region actually has overflowing content.

It's triggered by a ResizeObserver so it continually updates in response to anything that changes the element's size (and you can test this by resizing the window, increasing zoom or font-size).

https://cdpn.io/pen/debug/dyEXeKg/32a2f63b9f70a8727dc0c6bf9e5e69a7

Thoughts etc.?

(3/3)

aral, to SmallWeb
@aral@mastodon.ar.al avatar

So! Many! Kittens!

(Going to record a demo of the new interactive shell – REPL to some – and multi-page Settings this afternoon, just planning it out now.)

Oh and is that me creating and calling web routes interactively in the REPL on a live server? Why yes, yes it is.

:kitten:💕

markstos, to javascript
@markstos@urbanists.social avatar

Is EventEmitter the GOTO of #javascript ?

nucliweb, to javascript
@nucliweb@webperf.social avatar
aral, to SmallWeb
@aral@mastodon.ar.al avatar

:kitten: Kitten’s interactive shell (REPL) now saves session history scoped to your app so it will still be there when you next serve the same app.

https://codeberg.org/kitten/app#kitten-s-interactive-shell

I think I’m done with the REPL feature now.

Going to take a little break, step away from the computer, and make a plan for the next week of work on Kitten and Domain¹.

¹ https://codeberg.org/domain/app

stvfrnzl, to webdev
@stvfrnzl@mastodon.online avatar

I finally got for @astro working! Thanks to @henry sparking my interest for it (again) and anyone here who helped me along the way.

https://stevefrenzel.dev/posts/webmentions-in-astro-for-blog-posts/

I would appreciate lots of likes, reposts and comments so I have more data to work with hehe
😈

rauschma, to javascript
@rauschma@fosstodon.org avatar

Upcoming iterator methods:

// Without iterator methods:
const arr = Array.from(myMap.keys())
.filter(k => isPublic(k));

// With iterator methods:
const arr = myMap.keys()
.filter(k => isPublic(k))
.toArray();

(I prefer not to do .filter(isPublic) because isPublic() may gain more parameters in the future.)

https://2ality.com/2022/12/iterator-helpers.html

marmelab, to php
@marmelab@mastodon.social avatar

🎉 Exciting news! Marmelab is sponsoring the API Platform Conference 2024, the flagship event dedicated to the API Platform framework!

Join us for 2 days of talks by leading experts in , & .

📅 19 & 20 September
📍 Lille, France

Learn more: https://api-platform.com/fr/con/2024/

@cooptilleuls

nucliweb, to javascript
@nucliweb@webperf.social avatar

async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

https://gist.github.com/jakub-g/385ee6b41085303a53ad92c7c8afd7a6

ramikrispin, to datascience
@ramikrispin@mstdn.social avatar

Getting Started with Observable Framework 👇🏼

Here is a great resource for getting started with Observable Framework by Allison Horst. Observable Framework is an open-source JS library for creating dashboards. The sequence of videos covers how to set up a project and data loader, customize the dashboard, and deploy it.

📽️ https://www.youtube.com/playlist?list=PLOHIJAFwtkEcuVZO6WK-Uuswd09Y2Rk2b

scy, to javascript
@scy@chaos.social avatar

Theo on const vs let in :

https://youtu.be/dqmtzHB2zTM (32 min).

It's a long video, and he's basically only reacting to and commenting on Let me be https://www.epicweb.dev/talks/let-me-be (12 min) by Ryan Florence.

Theo's main point is that const doesn't mean "this value will never change" (since objects and arrays can obviously still be mutated), but that let means "pay attention, this value will be reassigned further down", and I totally agree.

toxi, (edited ) to typescript
@toxi@mastodon.thi.ng avatar

Useful snippet for computing pixel dimensions from paper sizes (both metric (DIN) and (US) imperial presets included) using https://thi.ng/units, an elaborate & powerful unit converter/calculator/DSL for all SI dimensions:

Full list of predefined constants:
https://github.com/thi-ng/umbrella/tree/develop/packages/units#constants

#ThingUmbrella #Units #Conversion #TypeScript #JavaScript

albertcardona, to javascript Catalan
@albertcardona@mathstodon.xyz avatar

“Coding my handwriting”, by Amy Goodchild. On specifying each handwritten character as a vector path, rather than a font, and then rendering text in various shapes and colours. Beautiful. In #javascript.

https://www.amygoodchild.com/blog/cursive-handwriting-in-javascript

dethos, to security
@dethos@s.ovalerio.net avatar
aral, to SmallWeb
@aral@mastodon.ar.al avatar

:kitten: 🎉

Kitten now has a lovely new multi-page Settings screen and… drumroll… a new 🐢 interactive shell (REPL) for you to play with the running state of your Small Web site/app/place and debug your app, inspect/manipulate its database, etc.

I plan on recording demos of each of them tomorrow but you can play with them now.

And here’s a little tutorial to get you started with the shell:

https://codeberg.org/kitten/app#kitten-s-interactive-shell

💕

Screenshot of Kitten running in terminal: 🌍 Domain https://localhost 📂 Source /var/home/aral/Projects/kitten/app/examples/file-uploads 💾 Databases /var/home/aral/.local/share/small-tech.org/kitten/databases 🐢 To launch an interactive shell, press the [s] key. Server is running and listening for connections… s 🐢 Launching interactive shell ctrl-d to exit; .help for assistance A good place to start is to run the .ls command to see the keys of the global kitten object: » 💡.ls is an alias for Object.keys(kitten) [ 'version', 'domain', 'port', 'app', 'databaseDirectory', 'projectIdentifier', 'deploy', 'WebSocket', 'html', 'libraries', 'page', 'events', 'css', 'js', 'markdown', 'md', 'safelyAddHtml', 'sanitise', 'uploadsDirectory', '_db', 'uploads', 'package', 'db' ] 🐱 💬 kitten.db.images[0] Proxy [ { path: '/uploads/1a6c2612-057d-435b-83c7-7157b4add982/', altText: 'Screenshot of Draw Together sketch that reads Free Gaza!' }, { get: [Function: bound getHandler], set: [Function: bound setHandler], defineProperty: [Function: bound definePropertyHandler], deleteProperty: [Function: bound deletePropertyHandler] } ] 🐱 💬

joe, to ai

LLaVA (Large Language-and-Vision Assistant) was updated to version 1.6 in February. I figured it was time to look at how to use it to describe an image in Node.js. LLaVA 1.6 is an advanced vision-language model created for multi-modal tasks, seamlessly integrating visual and textual data. Last month, we looked at how to use the official Ollama JavaScript Library. We are going to use the same library, today.

Basic CLI Example

Let’s start with a CLI app. For this example, I am using my remote Ollama server but if you don’t have one of those, you will want to install Ollama locally and replace const ollama = new Ollama({ host: 'http://100.74.30.25:11434' }); with const ollama = new Ollama({ host: 'http://localhost:11434' });.

To run it, first run npm i ollama and make sure that you have "type": "module" in your package.json. You can run it from the terminal by running node app.js <image filename>. Let’s take a look at the result.

Its ability to describe an image is pretty awesome.

Basic Web Service

So, what if we wanted to run it as a web service? Running Ollama locally is cool and all but it’s cooler if we can integrate it into an app. If you npm install express to install Express, you can run this as a web service.

The web service takes posts to http://localhost:4040/describe-image with a binary body that contains the image that you are trying to get a description of. It then returns a JSON object containing the description.

https://i0.wp.com/jws.news/wp-content/uploads/2024/05/Screenshot-2024-05-18-at-1.41.20%E2%80%AFPM.png?resize=1024%2C729&ssl=1

Have any questions, comments, etc? Feel free to drop a comment, below.

https://jws.news/2024/how-can-you-use-llava-and-node-js-to-describe-an-image/

tripleo, to random
@tripleo@fosstodon.org avatar

All you nutcases still using , what's actually wrong with it?

aka What are the sharp edges?

mjgardner,

@tripleo I would also be remiss not to mention #Perl's included perltrap manual page, which notes both the strict and warnings pragmas and also has nice lists of things for those coming from other #programming languages and tools like #AWK, #C and #CPlusPlus, #JavaScript, #sed, and #shell.

https://perldoc.perl.org/perltrap

ovid, to Lisp
@ovid@fosstodon.org avatar

, , and are three powerful programming languages that share a common feature.

Nobody knows how the hell to capitalize them.

ovid,
@ovid@fosstodon.org avatar

@tripleo I always have to look up the capitalization of Smalltalk because I get it wrong every time.

Hmm ... should be in that list.

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar

ECMAScript 2025 feature: duplicate named capturing groups for regular expressions
@rauschma
https://2ality.com/2024/05/proposal-duplicate-named-capturing-groups.html

#ECMAScript #JavaScript

zalasur, to javascript
@zalasur@mastodon.surazal.net avatar

It's been almost a decade since I've done a live coding stream. This will be fun!

Today I'll be migrating my website from React to Lit, which is a lightweight framework built around web components. I have the scaffolding set up mostly, so now it's time to get this done.

Come watch. Ask questions in chat! You don't need to create an account, just a username is needed to participate.

https://video.surazal.net/w/5S7FPXJMZh1i1eqZLY9mcV

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar
ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar
stefan, to javascript
@stefan@stefanbohacek.online avatar

I've been really enjoying working with Wikidata lately, setting up automated accounts like @libraries, @parks, and @lighthouses.

To see what else you can do with Wikidata, and to learn how to use it, check out a tutorial I put together: https://stefanbohacek.com/blog/making-a-map-of-unesco-world-heritage-sites/

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • khanakhh
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • ethstaker
  • Youngstown
  • mdbf
  • slotface
  • everett
  • rosin
  • ngwrru68w68
  • kavyap
  • thenastyranch
  • JUstTest
  • cubers
  • tacticalgear
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • modclub
  • Durango
  • Leos
  • normalnudes
  • megavids
  • tester
  • anitta
  • lostlight
  • All magazines