Famabara

Famabara languages

1 г. назад
Famabara currently supports 4 languages: English, Spanish, German and Russian.

The language setting affects the site interface. Also, the language must be specified when creating a post.
+2
86

What does Famabara mean?

1 г. назад
Famabara means... nothing :)

I wanted to come up with a pleasant-sounding and at the same time meaningless word.
There is only one Famabara in the world and you are now on it.
+2
71

The expectation paradox: he wanted a boy, but kept having girls

26 дн. назад
A man has five children - all girls. He dreams of a son, an heir! Now his wife is pregnant again. Let’s skip the psychology behind all this and focus on the probabilities.

Emotionally, it feels like after five girls in a row, a boy is due. Surely, the odds of finally having a son are much higher now.

But this is a textbook example of the gambler’s fallacy - the false belief that if something happens repeatedly, the opposite is bound to happen soon. That’s not how probability works.

According to math, the chance of having exactly five girls in a row followed by another girl is 1 in 64, or about 1.6%. But those five girls are already here. The only thing that matters now is the next birth.

And the odds of having a boy? Still 50/50. Every birth is an independent event (assuming randomness), so the previous outcomes don’t change the next one.

So yes, there’s still a 50% chance they’ll have another girl.
+1
6

Famabara is live

1 г. назад
Two years of development and now I can finally say with joy that Famabara is ready to show itself!

All the minimum required functionality is ready. Posts can be written, comments can be written, everything can be liked, added to favorites, etc.

In the near future, it is planned to implement the ability to create polls in posts.
+2
95

Famabara supports Open Graph protocol

недавно
Famabara has been around for over a year, but only now support for the Open Graph protocol is added. Now, when you paste links to Famabara posts, additional information is displayed. Here's a screenshot example from Telegram:
Or in Slack app:
+2
34

How to use Quill Editor with Nuxt 3 and SSR (Vue)

недавно
If you try to use Quill Editor with Nuxt 3 when rendering a page in SSR you will get this error:
500 document is not defined.
That means NodeJS doesn't have the global variable 'document'. Because SSR rendering is executed in
a NodeJS environment, not a browser.

The sad fact: <client-only> won't help with this problem. The problem with quill's code is that during import, it assumes it's being executed in the browser. I hope you remember that the code imported from the module is not just imported, but executed, i.e. the authors of Quill wrote it so that the 'document' object is immediately accessed there. Very bad.

One solution is to disable SSR, but its an awful solution. But the second solution is to use dynamic JS imports.

My <script lang="ts" setup> in QuillEditor.vue in Nuxt 3 project:
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
// import Quill from 'quill'; // SSR problem with 'document', need to use dynamic import
import type Quill from 'quill';

const elemForQuillEditor = ref<HTMLDivElement|null>(null);

let editor: null|Quill = null; // Do not store in ref() - it causes bugs!

// ...

async function createQuillAndSetListeners() {
  const Quill = (await import('quill')).default; // This is most important thing - usage of JS dynamic import

  if (!elemForQuillEditor.value) return;
  editor = new Quill(elemForQuillEditor.value, {
    theme: 'snow',
    modules: {
      history: {
        delay: 2000,
        maxStack: 500,
        userOnly: true,
      },
      toolbar: {
        container: [
          ['bold', 'italic', 'underline', 'strike'],
          ['link'],
          [{ list: 'ordered' }, { list: 'bullet' }],
          [{ script: 'sub' }, { script: 'super' }],
          [{ header: [1, 2, 3, 4, 5, 6, false] }],
          [{ color: [] }, { background: [] }],
          ['clean'],
          ['undo', 'redo'],
        ],
        handlers: {
          undo() {
            editor?.history.undo();
          },
          redo() {
            editor?.history.redo();
          },
        },
      },
    },
    placeholder: props.placeholder,
  });
  
  editor.on('text-change', () => {
    if (!editor) return;
    // ... my other code
  });
}

// ...

onMounted(createQuillAndSetListeners);

Now your Quill editor will work in Nuxt 3 even during SSR!
Показать полностью...
+2
18