Войдите или зарегистрируйтесь
Вы сможете писать комментарии и посты, ставить лайки и другое
Поиск
Тёмная тема

Preformatted text

1 г. назад
Famabara supports preformatted text now. You can use it inside posts and comments.

Just write some text between triple backticks "```".
Backticks must be placed in the beginning of a new line.

const years = [2024, 2030, 2050];
for (const year of years) {
  console.log(year);
};
It can be useful when showing some code - all spaces are saved:
<div>
  <div>
    Some text
  </div>
  <div>
    Other text
  </div>
</div>
+2
82

Latest changes on Famabara

недавно
Fixed a bug with displaying the number of unread comments.

Improved error display when mobile internet connection is lost.

Added a sticky loader when saving a comment.

Improved aria-attributes for screen readers.

Added Open Graph support for some pages.

When publishing a post, a like is automatically added to the published post.

In open posts, a button icon was added to quickly jump to comments.

Separate language-specific home pages were created on sub-URLs like /es, /de, etc.

The site header is now fixed at the top on most pages.
+2
62

Selfish tourists hog loungers with towels and don’t use them

недавно
I'm staying with my family at a five-star all-inclusive in Belek - not a cheap place. Around 8 or 9 in the morning we head straight to the sea for a swim, skipping the pool. By that time, the poolside loungers already look like this:
Показать полностью...
+4
16

Misleading naming in JavaScript: atob() and btoa()

недавно
JavaScript has two globally available metods for working with Base64: atob() and btoa(). Their names clearly look like they were borrowed from older languages. In C, for instance, the standard library includes functions like atoi and atof:

#include <stdlib.h>

char str[] = "123";
int num = atoi(str); // 123

atoi means ASCII to integer, and atof means ASCII to float (though in reality it returns a double).

So what do you think the atob function does in JavaScript? ASCII to Base64? In other words, converting a regular string into a Base64 string? Nope! It does the exact opposite: it converts a Base64 string into a "regular" string. And btoa, in turn, converts a regular string into Base64!

console.log(btoa('Famabara')); // 'RmFtYWJhcmE='
console.log(atob('RmFtYWJhcmE')); // 'Famabara'

Who thought it was a good idea to swap the names like that? Love JS.
+1
19