nogajun, to javascript Japanese
@nogajun@mastodon.social avatar

You can call me idol! 아님 어떤 다른 뭐라 해도って歌ったのかと思ったらもう一つの方だった

ユーザーが『アイドル』を歌うとサーバーが停止する - Qiita
https://qiita.com/laineus/items/7be14dac3eaac72a4cad

kubikpixel, to security
@kubikpixel@chaos.social avatar

Isn't RSA the current secure solution for the corresponding encryption/security on the browser with JavaScript?

»Galois/Counter Mode and random nonces:
It turns out you can encrypt more than 2^32 messages with AES-GCM with a random nonce under certain conditions. It’s still not a good idea, but you can just about do it.«

🤔 https://neilmadden.blog/2024/05/23/galois-counter-mode-and-random-nonces/
👨‍💻 https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#rsa-oaep_2


kubikpixel, to webdev German
@kubikpixel@chaos.social avatar

DomainFilter

A fully-typed class for filtering a list of domain names in various ways

📝 https://crock.github.io/DomainFilter/


penginn, to javascript

好きなだけおちんちん祭りを続けることができてしまったのです。

目に見えない文字を悪用してサイトを好き放題荒らされた話 [ - Qiita ]
https://qiita.com/laineus/items/2d168a57fdbf7cd7c9c3

fsf, to javascript
@fsf@hostux.social avatar

Nonfree may be taking away your freedom without your realizing it! Many web sites require proprietary JavaScript. Nonfree JavaScript subjugates users in the same way as any piece of proprietary software. Learn more: https://u.fsf.org/freejs

rauschma, to javascript
@rauschma@fosstodon.org avatar

:

This is legal syntax:
{3:3}

Why? You can use numbers as keys in object literals. That can be useful for destructuring [1]:

> const {0:a, 2:c} = ['zero', 'one', 'two'];
> a
'zero'
> c
'two'

However, this is not legal syntax:
> const x = {3};
SyntaxError: Unexpected number

Why? This is called a property value shorthand [2] and only works with names of variables.

[1] https://exploringjs.com/impatient-js/ch_destructuring.html
[2] https://exploringjs.com/impatient-js/ch_objects.html#object-literals-property-value-shorthands

rauschma,
@rauschma@fosstodon.org avatar

You can also destructure with computed property keys (*):

const key = 'a';
const {[key]: x} = {a:1, b:2};
assert.equal(x, 1);

(*) https://exploringjs.com/impatient-js/ch_objects.html#object-literals-computed-keys

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar
croc, to webdev
@croc@mastodon.social avatar

🤓 This is gonna be a extremely nerdy toot, but my most favorite piece of code I ever wrote is a small TypeScript library complete with unit tests that makes it super simple to filter a list of domain names by various criteria.

https://github.com/crock/domainfilter
https://www.npmjs.com/package/domainfilter

#domains #webdev #code #typescript #javascript

toxi, to genart
@toxi@mastodon.thi.ng avatar

Little Friday night gift for a friend (& example in ): How to generate & then recursively tessellate a hex grid and visualize as SVG, all via just https://thi.ng/geom & https://thi.ng/transducers...

Demo:
https://demo.thi.ng/umbrella/geom-hexgrid/

Source code:
https://github.com/thi-ng/umbrella/blob/develop/examples/geom-hexgrid/src/index.ts

(cc @nkint)

toxi,
@toxi@mastodon.thi.ng avatar

(Almost) same code, alternative tessellation (swapped order: first quad fan, then edge split). Also using 4 colors (vs two) to tint result polys...

#ThingUmbrella #Geometry #Hexagon #Grid #Tessellation #Recursion #GenerativeArt #SVG #TypeScript #Javascript

toxi,
@toxi@mastodon.thi.ng avatar
aral, to SmallWeb
@aral@mastodon.ar.al avatar

Kitten bugfix release:

Please upgrade to the latest release that fixes a regression introduced into sessions object with the latest JSDB¹/JSDF² upgrade:

https://codeberg.org/kitten/app/issues/177

Persisting arbitrary objects to sessions is a supported workflow and this regression broke that.

e.g., See the Kitten Count Sessions example: https://codeberg.org/kitten/app/src/branch/main/examples/kitten-count-sessions/index.page.js

:kitten:💕

¹ https://codeberg.org/small-tech/jsdb#javascript-database-jsdb
² https://codeberg.org/small-tech/jsdb#javascript-data-format-jsdf

#Kitten #SmallWeb #web #dev #sessions #JSDB #JavaScript #database #regression

tommi,
@tommi@pan.rent avatar

@aral Wonderful! Thanks for sharing! Once these hectic days will be over, I will definitely dive into some testing.

Thanks a lot, have a lovely weekend 💕🍉🚀

aral,
@aral@mastodon.ar.al avatar

@tommi You too, Tommi :)

:kitten:💕

twilliability, to javascript
@twilliability@genart.social avatar

Question folks! If I use destructuring assignment as below, is an actual array allocated for the function's return value, or does the runtime recognize this and optimize it away?

Asking for a friend living in a tight loop.

const [a, b] = foo();

quesebifurcan,
@quesebifurcan@mastodon.social avatar

@twilliability I'm not sure if it matters in practice, but it looks like v8 has been optimizing array destructuring since 2018 https://v8.dev/blog/v8-release-68#array-destructuring-improvements

twilliability,
@twilliability@genart.social avatar

@quesebifurcan This is exactly what I was looking for, thanks! If V8 has had it for 6 years, then I assume it's the same in FF too.

eikun_0903, to javascript Japanese
@eikun_0903@fedibird.com avatar
nurkiewicz, to javascript
@nurkiewicz@fosstodon.org avatar

"Top 5 Cutting-Edge #JavaScript Techniques". TL;DR:

  1. Monads (Asynchronous Operations)
  2. Declarative Programming
  3. Server-Side Caching for Improved Node.js Performance
  4. Immutability
  5. Pattern Matching

https://thenewstack.io/top-5-cutting-edge-javascript-techniques/

awlex,

@nurkiewicz They should make programming languages where those techniques are enforced by default

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

New Video – Kitten features introduced this week:

• Interactive Shell (REPL)
• Multi-page Settings
• Backup and restore (data portability)

With examples that cover components and Kitten’s built-in JavaScript database (JSDB).

https://ar.al/2024/05/23/new-kitten-features-interactive-shell-repl-multi-page-settings-and-backup-and-restore-data-portability/

:kitten:💕

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