Bitcoin Forum
June 27, 2024, 12:32:23 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 [155] 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 ... 763 »
3081  Bitcoin / Project Development / Re: [β] BPIP Extension: user info & extra features add-on/extension, Firefox/Chrome on: August 29, 2022, 03:56:04 PM
You still didn't show me the license for anything BPIP...and you claim it's open source.
Please show me the license.
I think what he means is that the code is easily inspectionable (just like if it was on GitHub), not necessarily licensed as an open source code.
3082  Local / Português (Portuguese) / Re: [ABERTO] 2º Sorteio - R$ 450 (entre 4 vencedores!) para criadores de tópicos on: August 29, 2022, 02:09:03 PM
seu primeiro link ficou "+entrada" e os seguintes "+ entrada"
não sei se isso afeta algo pro bot
Não mais, já corrigi para que ele entenda ambos como o mesmo comando.

Só não vão adicionar um +  entrada (2 espaços) Grin

edit: esqueci de dar os parabéns pela subida para Legendary, @joker_josue Cheesy
3083  Other / Meta / Re: Any custom script to put note on user? on: August 29, 2022, 12:47:18 PM
First of all, create a separate ANN thread for this. That would help to reach more users.
@TryNinja: do it please!
Done!
   
[Script] BitcoinTalk User Notes

~
I just tested a clean installation on Chrome and it works for me. Could you refresh the page (while on profile) with your browser's console open to see if there is any error message?

The note should be at the top, as shown in the screenshot:




I would love to see this integrated into the BPIP extension, as dkbit98 suggested. Is that possible?
That's up to @suchmoon and @ibminer. Cheesy
3084  Other / Meta / [Script] BitcoinTalk User Notes on: August 29, 2022, 12:46:51 PM
This was originally posted here.

It adds a note field on each user's profile and posts. You can click the note itself to remove or change it.

P.S: Notes are only stored LOCALLY and will be lost if you uninstall the extension. Only you can see your notes. You can import/export your notes by clicking the "User Notes" button next to the forum's Logout button.






Installation

- Install Tampermonkey (Chrome, Brave...) or Greasemonkey (Firefox). Or even better, Violentmonkey (open source alternative)
- Add a new script and paste the code:

Code:
// ==UserScript==
// @name         BitcoinTalk User Notes
// @version      0.3.1
// @description  Adds an note field to each user on BitcoinTalk
// @author       TryNinja
// @match        https://bitcointalk.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bitcointalk.org
// @grant GM.setValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

const enableModal = 1;

(async function() {
    'use strict';

    const addStyle = (css) => {
        const style = document.getElementById("GM_addStyleBy8626") || (() => {
        const style = document.createElement('style');
        style.id = "GM_addStyleBy8626";
        document.head.appendChild(style);
        return style;
        })();
        const sheet = style.sheet;
        sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
    }

    if (enableModal) {
        addStyle(`.modal {
            position: fixed;
            width: 100vw;
            height: 100vh;
            top: 0;
            left: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }`);

        addStyle(`.modal-bg {
            position: absolute;
            width: 100%;
            height: 100%;
        }`);

        addStyle(`.modal-container {
            min-width: 30vh;
            border-radius: 10px;
            background: #fff;
            position: relative;
            padding: 10px;
        }`);

        addStyle(`.modal-close {
            position: absolute;
            right: 15px;
            top: 15px;
            outline: none;
            appearance: none;
            color: red;
            background: none;
            border: 0px;
            font-weight: bold;
            cursor: pointer;
        }`);
    };

    const getValue = typeof GM_getValue === 'undefined' ? GM.getValue : GM_getValue;
    const setValue = typeof GM_setValue === 'undefined' ? GM.setValue : GM_setValue;

    const getParentNodeNth = (element, num) => {
        let parent = element;
        for (let i = 0; i < num; i++) {
            if (parent.parentNode) {
                parent = parent.parentNode;
            }
        }
        return parent;
    };

    const getNotes = async () => {
        let notes;
        try {
            notes = JSON.parse(await getValue('notes') ?? '{}');
        } catch (error) {
            notes = {};
        };
        return notes;
    };

    const setNotes = async notes => {
        if (typeof notes === 'string') {
            try {
                JSON.parse(notes);
                await setValue('notes', notes);
            } catch (error) {
                console.error('Notes value is an invalid JSON format')
            };
        } else if (typeof notes === 'object') {
            await setValue('notes', JSON.stringify(notes ?? {}));
        };
    };

    const getUserNote = async user => {
        const notes = await getNotes();
        if (!notes) {
            return null;
        }
        return notes[user];
    };

    const setUserNote = async (user, note) => {
        const notes = await getNotes();
        notes[user] = note;
        await setNotes(notes)
    };

    const texts = {
        addNote: '<a style="cursor: pointer; font-weight: bold" href="javascript:;">📜 Add Note</a>',
        withNote: note => `<a style="cursor: pointer; font-weight: bold" href="javascript:;"><b>📜</b> ${note}</a>`
    };

    const addNote = async (user, element) => {
        const note = prompt('Input the note (empty to remove):');
        if (note) {
            element.innerHTML = texts.withNote(note);
            await setUserNote(user, note);
        } else if (note !== null) {
            element.innerHTML = texts.addNote;
            await setUserNote(user, note);
        }
    };

    const exportNotesToInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');
        const notes = await getNotes();
        const notesJsonString = JSON.stringify(Object.keys(notes)
            .filter(user => notes[user]).reduce((obj, user) => ({...obj, [user]: notes[user]}), {}));

        notesInput.value = notesJsonString;
        notesImportExportDiv.querySelector('span').innerText = 'Export (copy the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'none';
    };

    const importNotesFromInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');

        notesInput.value = '';
        notesImportExportDiv.querySelector('span').innerText = 'Import (paste the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'inline-block';
    };

    const importNotesFromInputDone = async () => {
        const notesInput = document.querySelector('#notesInput');
        const confirmImport = confirm('Are you sure you want to override your local notes?');

        if (confirmImport && notesInput.value) {
            setNotes(notesInput.value);
            loadUserNotesList();
        }
    };

    const insertNotesModal = async () => {
        let notesModal = document.querySelector('#userNotesModal');

        if (!notesModal) {
            const moreMenuBtn = document.querySelector('body');
            notesModal = document.createElement('div');

            notesModal.innerHTML = `
                <div class="modal" id="modal-one">
                    <div class="modal-bg modal-exit"></div>
                    <div class="modal-container">
                        <div style="margin-bottom: 5px;">
                            <b style="font-size: 2rem;">User Notes</b>
                            <button class="modal-close modal-exit">X</button>
                        </div>

                        <div style="display: flex; align-items: center; margin-bottom: 5px;">
                            <button id="exportUserNotes">Export</button>
                            <button id="importUserNotes">Import</button>
                        </div>

                        <div>
                            <div style="display: none; flex-direction: column;" id="notesImportExportDiv">
                                <span id="notesInputText"></span>
                                <input id="notesInput" />
                                <button id="doneImportButton" style="display: none;">Done</button>
                            </div>

                        </div>

                        <div id="userNotesList" />
                    </div>
                </div>`;
            notesModal.classList.add('modal');
            notesModal.style.visibility = 'hidden';
            notesModal.setAttribute('id', 'userNotesModal');

            moreMenuBtn.after(notesModal);

            const exportButton = document.querySelector('#exportUserNotes');
            const importButton = document.querySelector('#importUserNotes');
            const doneImportButton = document.querySelector('#doneImportButton');

            exportButton.addEventListener('click', () => exportNotesToInput());
            importButton.addEventListener('click', () => importNotesFromInput());
            doneImportButton.addEventListener('click', () => importNotesFromInputDone());
        };

        return notesModal;
    };

    const loadUserNotesList = async () => {
        const userNotesList = document.querySelector('#userNotesList');

        const notes = await getNotes();

        if (Object.keys(notes).length) {
            userNotesList.innerHTML = Object.keys(notes)
            .filter(user => notes[user])
            .map((user) => `<a href="https://bitcointalk.org/index.php?action=profile;u=${user}" target="_blank">${user}</a>: ${notes[user]}`).join('<br/>');
        } else {
            userNotesList.innerHTML = 'No notes...';
        };
    };

    const insertUserNotesMenuButton = async () => {
        let notesBtn = document.querySelector('#userNotesMenuBtn');
        const modal = await insertNotesModal();
        const modalExit = modal.querySelectorAll('.modal-exit');

        if (!notesBtn) {
            const moreMenuBtn = document.querySelector(`a[href='/more.php']`).parentNode;
            notesBtn = document.createElement('td');

            notesBtn.innerHTML = '<td><a href="javascript:;" id="openUserNotes">User Notes</a></td>';
            notesBtn.classList.add('maintab_back');
            notesBtn.setAttribute('id', 'userNotesMenuBtn');
            moreMenuBtn.after(notesBtn);

            const openUserNotes = document.querySelector('#openUserNotes')
            const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
            const notesInput = document.querySelector('#notesInput');

            openUserNotes.addEventListener('click', () => {
                modal.style.visibility = 'visible';
                modal.style.opacity = 1;
                notesImportExportDiv.style.display = 'none';
                notesInput.value = '';
                loadUserNotesList();
            });
            modalExit.forEach(el => el.addEventListener('click', () => {
                modal.style.visibility = 'hidden';
                modal.style.opacity = 0;
            }));
        }

        return notesBtn;
    };

    if (enableModal) {
        insertNotesModal();
        insertUserNotesMenuButton();
    };

    if (window.location.href.match(/topic=\d+/)) {
        const targets = [...document.querySelectorAll('td.poster_info div a:last-child')]
        .filter(e => window.getComputedStyle(getParentNodeNth(e, 11)).display !== 'none');

        targets.map(async target => {
            const [_, userId] = [...target.parentNode.parentNode.childNodes].find(childNode => childNode.innerHTML).innerHTML.match(/u=(\d+)/);
            const noteDiv = document.createElement('div');
            const note = await getUserNote(userId);
            if (!note) {
                noteDiv.innerHTML = texts.addNote;
            } else {
                noteDiv.innerHTML = texts.withNote(note);
            }
            target.before(noteDiv);
            noteDiv.addEventListener('click', () => addNote(userId, noteDiv), false);
        });
    } else if (window.location.href.match(/profile;u=\d+$/)) {
        const [_, userId] = window.location.href.match(/u=(\d+)/);
        const target = getParentNodeNth(document.querySelector('#bodyarea table tr td tbody tr:nth-child(2) tr:last-child').parentNode, 1);
        const noteDiv = document.createElement('div');
        const note = await getUserNote(userId);
        if (!note) {
            noteDiv.innerHTML = texts.addNote;
        } else {
            noteDiv.innerHTML = texts.withNote(note);
        }
        target.before(noteDiv);
        noteDiv.addEventListener('click', () => addNote(userId, noteDiv), false);
    }
})();
3085  Other / Meta / Re: Any custom script to put note on user? on: August 28, 2022, 06:35:37 PM
2. When I visit the user profile, I can't see the note. Possible to put it there too?
You should (screenshot number 1 and 2). What's your browser? Any other custom script/extension that modifies the forum page?
3086  Local / Português (Portuguese) / Re: Um juri descentralizado para arbitrar conflitos entre DAOs on: August 28, 2022, 03:02:03 PM
Sobre o ponto 1, me parece um cenário estranho, porque a pessoa precisaria a priori saber que precisaria desse serviço e se preparar para esse momento. É quase como se você prevesse que vai fazer merda e já se equipasse para comprar o juri. Acho que isso deve acontecer talvez até que bastante em altos escalões de política/empresários. Mas como o serviço não é hiper conhecido e não é uma ''metodologia de solução de conflitos'' estabelecida, parece dificil. E, a medida que essa solução cresce como opção, me parece razoável sugerir que seria mais dificil esse ataque, não?
Acho que é possível no caso em que um projeto é conhecido por terceirizar decisões através desse juri. Por exemplo, sou o dev de um projeto e vou fazer algo que me beneficie bastante e que tem altas chances de ser resolvido pelo juri descentralizado. Também posso simplesmente sugerir essa solução, sendo que eu já estou preparando um "golpe" por lá. Cheesy

Não digo que é necessariamente um risco gigantesco, mas ainda me parece um vetor de ataque.
3087  Local / Português (Portuguese) / Re: Dos smart contracts A+ ao STAY AWAY FROM SUCH CONTRACT! on: August 28, 2022, 01:41:16 PM
Mas não sei se entendo como isso é feito em termos de imagem? Ai cada letra/número chama um pixel em um formato pré-setado? Tem algum texto/gerador que tu possa indicar pra eu entender melhor como acontece isso? E ai nesse caso, a imagem é codificada no base 64 ou o código é gerado e ele é a arte em si?
Existem diversos conversores (inclusive sites) que convertem os bytes da imagem para base64. Depois é só renderizar ela, tanto que você pode fazer isso em qualquer navegador ao adicionar o prefixo data:image/png;base64, ...

Segue a sua imagem de perfil (da Roobet) em base64:

Code:
-censurado para não quebrar a minha página de posts-

Se você copiar tudo isso e colar na barra do navegador e apertar enter, vai renderizar a imagem igualzinha. Cool



O que o contrato do Nouns faz é utilizar um banco de dados onchain (tal parte representa tal coordenadas que geram tal retangulo em SVG) para formar a imagem por partes, e depois codificá-la em base64.
3088  Local / Português (Portuguese) / Re: [ABERTO] 2º Sorteio - R$ 450 (entre 4 vencedores!) para criadores de tópicos on: August 28, 2022, 01:32:06 PM
Queria adicionar um novo prêmio ao concurso, mas com uma nova regra, não sei se daria pra fazer @TryNinja, mas queria oferecer R$150 para o tópico em todas as entradas realizadas que receber a maior quantidade de merits. O teu bot conseguiria pegar essa info ou precisaria checar manualmente? A ideia é ser uma forma de premiar aquele que criou o tópico que nossa comunidade entendeu como de mais valor no período em questão. E não premiar aquele com mais sorte.
Opa, então é um único prêmio extra de R$ 150 para quem fez o tópico que conseguiu mais merits? O bot ainda não faz isso, mas gostei da ideia! Vou implementar algo como uma contagem de merits (tópico com mais merits e usuário com a maior somatória de merits entre todas as suas entradas). Grin

Obrigado pela contribuição! Smiley
3089  Local / Português (Portuguese) / Re: [ABERTO] 2º Sorteio - R$ 450 (entre 4 vencedores!) para criadores de tópicos on: August 28, 2022, 12:31:49 PM
obs: @TryNinja, teria como voce confirmar se esse topico (feito por mim) foi validado com sucesso pelo seu bot?
Você mesmo pode conferir verificando o post do bot depois de 1-2 minutos. Já está lá como a sua entrada de número 4.

Ah, alias... com relação aos vencedores desse sorteio, o sorteado terá a chance de ganhar somente 1 premio? Ou um usuário terá a chance de ficar com o 1°, 2° 3° e 4° lugar por exemplo?
Cada pessoa só pode ganhar 1x. Se sair repetido, o bot vai verificar o próximo ticket até dar um novo vencedor.
3090  Local / Português (Portuguese) / Re: [ARTIGO - TCC] Armazenamento de Dados: Blockchain VS Nuvem. Qual a melhor? on: August 28, 2022, 12:28:12 PM
Boa! Acho que ficou faltando exemplificar quanto custaria para guardar um tamanho grande de arquivos na Filecoin (ainda que não tenha um preço fixo, poderia dar uma olhada em quanto custaria hoje em dia de forma prática).

Pesquisei aqui e eles parecem cobrar[1] < $1 por TiB/ano vs $24 TiB/ano do S3 Glacier Deep Archive, uma vantagem absurda de preço. Falando em Glacier Deep Archive, acho que poderia comentar sobre os diferentes níveis de armazenamento, assim como presentes na AWS.  O S3 Standard cobra 0,023 USD/GB para o armazenamento geral que é acessado com frequência, enquanto o S3 Glacier Deep Archive cobra[2] apenas 0,00099 USD/GB (23x menos) para armazenar arquivos de longa vigência, que são acessados 1 ou 2 vezes por ano e podem ser restaurados em até 12 horas (ótimo para backups profundos, i.e o que o GitHub faz com o Arctic Code Vault[3]).

[1] https://largedata.filecoin.io/#pricing
[2] https://aws.amazon.com/pt/s3/pricing/?nc=sn&loc=4
[3] https://archiveprogram.github.com/arctic-vault/
3091  Other / Meta / Re: Any custom script to put note on user? on: August 27, 2022, 05:11:26 PM
Yes I did but as you see there are nothing for me.

I am using Firefox with tor connection. Is that a problem? It should not be though.
It seems like Greasymonkey (Firefox version) has some breaking differences from Tampermonkey (Chrome). Update the script (same post) and it should work now. Smiley
3092  Other / Meta / Re: Any custom script to put note on user? on: August 27, 2022, 03:49:09 PM
Now how do I add note to users?
Did you manage to install the script? You should see the "Add Note" text on everyone's profile and post (see the image above). Just click on it and a prompt should pop up. You can also click the note (i.e the "good guy!" in the image) to edit or remove the note.
3093  Other / Meta / Re: Any custom script to put note on user? on: August 27, 2022, 03:36:37 PM
Do you have a set of instruction to install it
Install the Tampermonkey extension if you are using any Chromium based browser (Chrome, Brave, Opera...) or Greasemonkey if you are using Firefox (untested)

Then open the extension's popup/page -> Add new script -> Paste the code and save.
3094  Other / Meta / Re: Any custom script to put note on user? on: August 27, 2022, 01:31:56 PM
edit: updated to 0.3, check the new thread for more info.

I created something, what do you think?





P.S: This is stored locally and only works with TamperMonkey (and GreaseMonkey + forks probably). Maybe I can add an option to list all notes and import/export if it's usefull.

Code:
// ==UserScript==
// @name         BitcoinTalk User Notes
// @version      0.3
// @description  Adds an note field to each user on BitcoinTalk
// @author       TryNinja
// @match        https://bitcointalk.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bitcointalk.org
// @grant GM.setValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

const enableModal = 1;

(async function() {
    'use strict';

    const addStyle = (css) => {
        const style = document.getElementById("GM_addStyleBy8626") || (() => {
        const style = document.createElement('style');
        style.id = "GM_addStyleBy8626";
        document.head.appendChild(style);
        return style;
        })();
        const sheet = style.sheet;
        sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
    }

    if (enableModal) {
        addStyle(`.modal {
            position: fixed;
            width: 100vw;
            height: 100vh;
            top: 0;
            left: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }`);

        addStyle(`.modal-bg {
            position: absolute;
            width: 100%;
            height: 100%;
        }`);

        addStyle(`.modal-container {
            min-width: 30vh;
            border-radius: 10px;
            background: #fff;
            position: relative;
            padding: 10px;
        }`);

        addStyle(`.modal-close {
            position: absolute;
            right: 15px;
            top: 15px;
            outline: none;
            appearance: none;
            color: red;
            background: none;
            border: 0px;
            font-weight: bold;
            cursor: pointer;
        }`);
    };

    const getValue = typeof GM_getValue === 'undefined' ? GM.getValue : GM_getValue;
    const setValue = typeof GM_setValue === 'undefined' ? GM.setValue : GM_setValue;

    const getParentNodeNth = (element, num) => {
        let parent = element;
        for (let i = 0; i < num; i++) {
            if (parent.parentNode) {
                parent = parent.parentNode;
            }
        }
        return parent;
    };

    const getNotes = async () => {
        let notes;
        try {
            notes = JSON.parse(await getValue('notes') ?? '{}');
        } catch (error) {
            notes = {};
        };
        return notes;
    };

    const setNotes = async notes => {
        if (typeof notes === 'string') {
            try {
                JSON.parse(notes);
                await setValue('notes', notes);
            } catch (error) {
                console.error('Notes value is an invalid JSON format')
            };
        } else if (typeof notes === 'object') {
            await setValue('notes', JSON.stringify(notes ?? {}));
        };
    };

    const getUserNote = async user => {
        const notes = await getNotes();
        if (!notes) {
            return null;
        }
        return notes[user];
    };

    const setUserNote = async (user, note) => {
        const notes = await getNotes();
        notes[user] = note;
        await setNotes(notes)
    };

    const texts = {
        addNote: '<a style="cursor: pointer; font-weight: bold" href="javascript:;">📜 Add Note</a>',
        withNote: note => `<a style="cursor: pointer; font-weight: bold" href="javascript:;"><b>📜</b> ${note}</a>`
    };

    const addNote = async (user, element) => {
        const note = prompt('Input the note (empty to remove):');
        await setUserNote(user, note);
        if (note) {
            element.innerHTML = texts.withNote(note);
        } else if (note !== null) {
            element.innerHTML = texts.addNote;
        }
    };

    const exportNotesToInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');
        const notes = await getNotes();
        const notesJsonString = JSON.stringify(Object.keys(notes)
            .filter(user => notes[user]).reduce((obj, user) => ({...obj, [user]: notes[user]}), {}));

        notesInput.value = notesJsonString;
        notesImportExportDiv.querySelector('span').innerText = 'Export (copy the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'none';
    };

    const importNotesFromInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');

        notesInput.value = '';
        notesImportExportDiv.querySelector('span').innerText = 'Import (paste the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'inline-block';
    };

    const importNotesFromInputDone = async () => {
        const notesInput = document.querySelector('#notesInput');
        const confirmImport = confirm('Are you sure you want to override your local notes?');

        if (confirmImport && notesInput.value) {
            setNotes(notesInput.value);
            loadUserNotesList();
        }
    };

    const insertNotesModal = async () => {
        let notesModal = document.querySelector('#userNotesModal');

        if (!notesModal) {
            const moreMenuBtn = document.querySelector('body');
            notesModal = document.createElement('div');

            notesModal.innerHTML = `
                <div class="modal" id="modal-one">
                    <div class="modal-bg modal-exit"></div>
                    <div class="modal-container">
                        <div style="margin-bottom: 5px;">
                            <b style="font-size: 2rem;">User Notes</b>
                            <button class="modal-close modal-exit">X</button>
                        </div>

                        <div style="display: flex; align-items: center; margin-bottom: 5px;">
                            <button id="exportUserNotes">Export</button>
                            <button id="importUserNotes">Import</button>
                        </div>

                        <div>
                            <div style="display: none; flex-direction: column;" id="notesImportExportDiv">
                                <span id="notesInputText"></span>
                                <input id="notesInput" />
                                <button id="doneImportButton" style="display: none;">Done</button>
                            </div>

                        </div>

                        <div id="userNotesList" />
                    </div>
                </div>`;
            notesModal.classList.add('modal');
            notesModal.style.visibility = 'hidden';
            notesModal.setAttribute('id', 'userNotesModal');

            moreMenuBtn.after(notesModal);

            const exportButton = document.querySelector('#exportUserNotes');
            const importButton = document.querySelector('#importUserNotes');
            const doneImportButton = document.querySelector('#doneImportButton');

            exportButton.addEventListener('click', () => exportNotesToInput());
            importButton.addEventListener('click', () => importNotesFromInput());
            doneImportButton.addEventListener('click', () => importNotesFromInputDone());
        };

        return notesModal;
    };

    const loadUserNotesList = async () => {
        const userNotesList = document.querySelector('#userNotesList');

        const notes = await getNotes();

        if (Object.keys(notes).length) {
            userNotesList.innerHTML = Object.keys(notes)
            .filter(user => notes[user])
            .map((user) => `<a href="https://bitcointalk.org/index.php?action=profile;u=${user}" target="_blank">${user}</a>: ${notes[user]}`).join('<br/>');
        } else {
            userNotesList.innerHTML = 'No notes...';
        };
    };

    const insertUserNotesMenuButton = async () => {
        let notesBtn = document.querySelector('#userNotesMenuBtn');
        const modal = await insertNotesModal();
        const modalExit = modal.querySelectorAll('.modal-exit');

        if (!notesBtn) {
            const moreMenuBtn = document.querySelector(`a[href='/more.php']`).parentNode;
            notesBtn = document.createElement('td');

            notesBtn.innerHTML = '<td><a href="javascript:;" id="openUserNotes">User Notes</a></td>';
            notesBtn.classList.add('maintab_back');
            notesBtn.setAttribute('id', 'userNotesMenuBtn');
            moreMenuBtn.after(notesBtn);

            const openUserNotes = document.querySelector('#openUserNotes')
            const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
            const notesInput = document.querySelector('#notesInput');

            openUserNotes.addEventListener('click', () => {
                modal.style.visibility = 'visible';
                modal.style.opacity = 1;
                notesImportExportDiv.style.display = 'none';
                notesInput.value = '';
                loadUserNotesList();
            });
            modalExit.forEach(el => el.addEventListener('click', () => {
                modal.style.visibility = 'hidden';
                modal.style.opacity = 0;
            }));
        }

        return notesBtn;
    };

    if (enableModal) {
        insertNotesModal();
        insertUserNotesMenuButton();
    };

    if (window.location.href.match(/topic=\d+/)) {
        const targets = [...document.querySelectorAll('td.poster_info div a:last-child')]
        .filter(e => window.getComputedStyle(getParentNodeNth(e, 11)).display !== 'none');

        targets.map(async target => {
            const [_, userId] = [...target.parentNode.parentNode.childNodes].find(childNode => childNode.innerHTML).innerHTML.match(/u=(\d+)/);
            const noteDiv = document.createElement('div');
            const note = await getUserNote(userId);
            if (!note) {
                noteDiv.innerHTML = texts.addNote;
            } else {
                noteDiv.innerHTML = texts.withNote(note);
            }
            target.before(noteDiv);
            noteDiv.addEventListener('click', () => addNote(userId, noteDiv), false);
        });
    } else if (window.location.href.match(/profile;u=\d+/)) {
        const [_, userId] = window.location.href.match(/u=(\d+)/);
        const target = getParentNodeNth(document.querySelector('#bodyarea table tr td tbody tr:nth-child(2) tr:last-child').parentNode, 1);
        const noteDiv = document.createElement('div');
        const note = await getUserNote(userId);
        if (!note) {
            noteDiv.innerHTML = texts.addNote;
        } else {
            noteDiv.innerHTML = texts.withNote(note);
        }
        target.before(noteDiv);
        noteDiv.addEventListener('click', () => addNote(userId, noteDiv), false);
    }
})();
3095  Local / Português (Portuguese) / Re: Arquivo de Posts e outras tools - ninjastic.space on: August 27, 2022, 09:22:24 AM
Uma questão:
É possível de uma forma fácil, ver através da plataforma, o top dos users com mais posts?
Sim. Todos aqueles posts sobre quem mais é ativo no nosso board (que é sempre você) usam os dados do meu site. Cheesy

1. https://ninjastic.space/search
2. Bota os filtros que você quer (i.e board "Português" e marca para incluir os child boards; do dia X até o dia Y) -> Pesquisa.
4. Clica na aba Users -> Generate.

Mas já penso em automatizar esses "reports mensais" em uma página exclusiva.
3096  Local / Português (Portuguese) / Re: Um juri descentralizado para arbitrar conflitos entre DAOs on: August 26, 2022, 11:52:14 PM
Muito interessante! Preciso ler mais os docs do projeto para entender como tudo funciona, mas vejo que esse juri já agiu em cima de alguns casos bem sucedidos: https://kleros.gitbook.io/docs/products/court/famous-kleros-cases

Os maiores riscos desse tipo de disputa, em minha opinião, são:

1. De um ataque sybil com o token da PNY, onde um terceiro malicioso seria responsável por grande parte do juri da rede e é escalado para resolver uma disputa (precisaria analisar o free-floating e liquidez do token, mas talvez viável em uma disputa multimilionária).

2. Falta de incentivo. Todo mundo sabe que a maioria dos projetos crypto sobrevivem, em suas fases inicias, apenas graças à pura especulação que não tem qualquer base fundamental verdadeira. Se eu recebo tokens do projeto para garantir a minha boa fé na resolução das disputas, só tenho incentivo enquanto o token vale alguma coisa. Agora ele vale, mas e depois? De acordo com a documentação do projeto, 18% do supply foi destinado aos membros do devteam, 12% à uma reserva de desenvolvimento, e 50% fazem parte do "programa de incentivo".
3097  Alternate cryptocurrencies / Altcoin Discussion / Re: How is possible, see BCH before hard fork on: August 26, 2022, 11:28:44 PM
I would not be surprised the block explorer you're looking at would show the genesis block contain the famous "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks." and still lie it's BCH  Cheesy
Remember that the BCH community unironically thinks they are the "real Bitcoin" and some even think Craig Wright is satoshi (who wrote this), so yes, that's also included there. We (the "segwit Bitcoin") are the malicious/corporate fork. Smiley Tongue
3098  Other / Meta / Re: Making a backup of this website with HTTrack on: August 26, 2022, 11:21:01 PM
Based on LoyceV's information from two years ago, the required storage space for the entire bitcointalk forum is probably somewhere around 60GB, at the moment.
My archive directory is currently 146 GB. That includes some duplicate indices because I don't use a database.
Mine weights around 58 GB (Postgres database with parsed content/data, counting only the "posts" table), but I probably have some posts missing (not too many, I hope?).
3099  Local / Português (Portuguese) / Re: [LISTA] Carteiras de hardware on: August 26, 2022, 10:23:28 PM
Parece que o pessoal não gosta da Ledger Nano S, que seria a minha escolha devido ao preço ( 59 dólares )
Alguém aqui utiliza esse modelo da Ledger e já tem faz bastante tempo?
Quem não gosta?

Tive o Nano S por vários e vários anos (uns 4-5?), nunca tive qualquer problema com ele. Só quebrou recentemente por que deixei ele em cima da mesa do lado do copo gelado e molhou quando começou a condensar.

Hoje em dia eles não vendem mais o Nano S, pois desenvolveram o "Nano S Plus" que tem uma tela maior e mais espaço para os apps (também recomendo). Pegaria outro fácil, mas parei um pouco de mexer com o DeFi e não preciso tanto.
3100  Local / Português (Portuguese) / Re: Dos smart contracts A+ ao STAY AWAY FROM SUCH CONTRACT! on: August 26, 2022, 09:40:40 PM
TryNinja, se eu entendi bem, a diferença é que enquanto um referencia uma URL onde é feito um storage de determinada arte, no outro, a própria geração da arte é feita no on-chain?
Sim.

A maioria só diz: a arte está hospedada no link XXXX, acesse ele para vê-la.
A Nouns diz: esse token tem a arte ZGFkYWRh.... (base64).

O próprio base64 já é a imagem em si.

Agora que eu entendi o que o joker quis dizer, não tinha percebido que o titulo fala em "smartcontracts" de forma generica.
Pages: « 1 ... 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 [155] 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 ... 763 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!