Recent submissions

Comment · 8 months ago
Logseq supports some of org mode syntax.
Comment · 10 months ago
I'm mostly using this nowadays >>> subprocess.getoutput('ls')
Comment · 1 year ago
> Emacs on my phone sounds lovely!

Meanwhile, you can use it in termux if you are on android right now.

Comment · 1 year ago
Logseq actually supports orgmode files on android (and desktop) in some extent, for me it works better than orgzly.
Comment · 1 year ago
I mean the pandemic was not too long ago, a lot of us actually remember the accessible treatments back then.

First they discovered steroids like prednisolone which were useful only for heavily sick patients, then they started to distribute antibody plasma from other patients, then monoclonal antibodies and some cytokine inhibitors and when everybody who wanted already got vaccinated, we got antivirals such as Paxlovid, and it was scarce.

There were a lot of misunderstanding around hydroxychloroquine and ivermectin, similarly how we have a lot of misunderstanding around vaccines and autism. And they were tested and tested and tested, similarly how we still check if vaccines cause autism. And all the proper research showed that hydroxychloroquine and ivermectin were absolutely ineffective, times and times again, but people just couldn't let them go, similarly to how people can't let go the fake autism-vaccine connection.

In the first part of the pandemic, vaccines were the best we had.

Comment · 1 year ago
Thank you for the answers. Even I'm not new to TTS usage, overall, this feels a bit like cyberpunk for me, like a neural interface that can provide you information as fast as you can consume it, not just how fast your "ears" can recognize it. Like a human modem.
Comment · 1 year ago
Really liked the article.

The interesting part for me was that you can recognize synthetic voice much faster than human speech. Is there a specific voice you are using for 800wpm or it can be any TTS? Also, I think older voices sound more robotic that the newer ones (I mean pre AI, like the default on android is newer for me). Is there a difference for how fast you can listen to the newer more nicely sounding ones or the older more robotic ones?

Comment · 1 year ago
JS used to have those, now they are deprecated though:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

so it settled on having this syntax for similar cases using "Symbol":

class Foo { *[Symbol.iterator]() { yield 1; yield 2; yield 3; } }

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Comment · 1 year ago
> I won't buy anything made in US and sold here anymore.

Not to counter the argument, but just if I would consider doing the same. What to do with laptops - Apple (silicon), Intel, AMD and Qualcomm are all US companies.

Comment · 1 year ago
> I use orgzly

A couple of alternative options, none of which are perfect, are using Termux with installed Emacs or Logseq, which supports org-mode syntax for files.

Comment · 2 years ago
It has a webui, but this is how I use it from python (sorry I like python, but similar connection method should work from the other langs too).

    ai = openai.AsyncOpenAI(base_url="http://localhost:8080/v1", api_key="sk-no-key-required")
    response = await ai.chat.completions.create(
        messages=[
            {"role": "system", "content": "..."}, {"role": "user", "content": "..."},
        ],
        max_tokens=100,
        model="Llama-3.2-1B-Instruct.Q6_K.gguf",
    )

    content = response.choices[0].message.content
Comment · 2 years ago
IMO the simplest option is llamafile (it is multiplatform using "cosmopolitan" lib so should run on Windows too, but I haven't tried)

    wget https://huggingface.co/Mozilla/Llama-3.2-1B-Instruct-llamafile/resolve/main/Llama-3.2-1B-Instruct.Q6_K.llamafile
    chmod +x Llama-3.2-1B-Instruct.Q6_K.llamafile
    ./Llama-3.2-1B-Instruct.Q6_K.llamafile --server
Comment · 2 years ago
I hanen't touched Django in some time, but something like this should work:

    from django.db import models
    from django.db import connection

    class MyModel(models.Model):
        name = models.CharField(max_length=255)

        class Meta:
            app_label = 'myapp'


    with connection.schema_editor() as schema_editor:
        schema_editor.create_model(MyModel)

    # from django.core.management import call_command
    # call_command('makemigrations', 'myapp')
    # call_command('migrate', 'myapp')
Comment · 2 years ago
Additionally to the provided answers:

if sanity_check(): variable = something()

variable = sanity_check() and something

(but the standard python two line way is more readable unless it's a throwaway single use code, then whatever)

Comment · 2 years ago
For my personal needs, when it's not used as a build system but for collecting some shell functions in a file, I've completely switched to a combination of xonsh/python-fire and never looked back. Xonsh looks a bit weird, but it's superfast to write, and I always can read it perfectly. A messy example - one of my local scripts:

../bin/ok:

    #!/usr/bin/env xonsh
    """
    $> ok android shell
    $> ok android ssh
    $> ok android sshd
    $> ok android sms
    """
    import fire as _fire

    class android:
        ip = '...;

        def shell(self):
            adb connect f'{self.ip}:5555'
            adb shell

        def sshd(self):
            adb connect f'{self.ip}:5555'
            adb shell input keyevent 26
            adb shell input swipe 500 800 500 300 200
            sleep 1
            adb shell am start -n com.termux/.app.TermuxActivity
            adb shell input text "sshd"
            adb shell input keyevent 66
            adb shell input text "exit"
            adb shell input keyevent 66

        def ssh(self):
            ssh -p 8022 f'user@{self.ip}'

        def sms(self):
            result = $(ssh -p 8022 f'user@{self.ip}' termux-sms-list -l 20 | jq ".[].body")
            print(result)
            def long_echo(): print(result)
            @(long_echo) | llm -m llama3 -s 'please translate messages to English, quote the original messages too'

    if __name__ == '__main__':
        _fire.Fire()

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton