News for hackers. Stuff that matters.

omnster

Re:Scripts I wrote that I use all the time on Friday October 24, 2025 @06:51AM (#45693255)
Regarding the `timer` script, it appears to block the shell. A way to avoid this would be to spawn a subshell for the sleep command like this: `( sleep "$1" && notify ... ) &`
Re:I tried every todo app and ended up with a .txt file on Monday August 11, 2025 @05:39PM (#44869778)
You can perhaps use `strftime` instead of `trim(system('date ..))`:

   inoremap <Leader>date <C-r>=strftime("%a %B %e, %Y %H:%M:%S %p")<CR>
   nnoremap <Leader>date :put=strftime("%a %B %e, %Y %H:%M:%S %p")<CR>
I am also not sure if an `<esc>` is really necessary at the end of your normal mode map.
Re:You Can Choose Tools That Make You Happy on Monday May 26, 2025 @04:35AM (#44095292)
In defence of emacs: if I were using emacs, I'd be doing that not because of Neal Stephenson's essay, but rather because of the long-established legacy of the development, and because of the community. I believe that the combination of these two factors is very likely protecting emacs from a sudden enshittification so typical for proprietary software. I'm in the vim church, but for exactly the same reasons.
Re:I maintain a 17 year old ThinkPad on Thursday April 03, 2025 @03:50AM (#43566267)
Exactly. We can also win a tiny bit of the distance by assuming the Moon in the perigee, where the distance to the Moon is about 363000 km. I also assume that these distances are measured between the centers, so we can perhaps subtract twice the Earth radius (about 2*6400 km).
Re:Show HN: Markwhen: Markdown for Timelines on Monday December 02, 2024 @04:55PM (#42300844)
Looks neat! Is there a way to make it work with pandoc?
Re:Google Scholar PDF Reader on Friday March 22, 2024 @07:31AM (#39789603)
Here's a guide I found useful to set up zotero storage. In brief, it relies on zotfile to flatten the storage (keep all pdfs in one directory) and better bibtex.

I realized that it helped me to get rid of exactly the pain with fresh installs that you mention. I realized that the two plugins give me most of the functionality that I want.

https://habr.com/ru/articles/443798/

Re:Show HN: Improve cognitive focus in 1 minute on Thursday February 08, 2024 @02:01AM (#39299119)
Great work, helped me to calm down a bit!

There was a bit of jumpscare for me at the end though: when the circle jumps back to being a button again. May I suggest adding a slower deflation?

Re:How does Shazam work? (2022) on Wednesday December 06, 2023 @03:32AM (#38541655)
I'd assume adding noise is done once per song and is thus a bit computationally cheaper than trying to denoise each input.
There is quite an excitement about how someone has hacked the language model to output what was supposed to be a non-public set of rules apparently. How do people know if this is indeed the secret set of rules, not the list that the model was scripted to return in response to a request (perhaps, a bit elaborate) for the list of rules?
Re:Solving the cube root of 19,683 mentally on Saturday February 04, 2023 @01:27PM (#34656730)
Reminded me of the story about Feynman being challenged by an abacist to compute cubic root

https://www.ecb.torontomu.ca/~elf/abacus/feynman.html

Re:LaTeX Makes Me Angry on Tuesday October 11, 2022 @05:15PM (#33169349)
Define your \newcommands in commands.tex and tell pandoc to add it to the header: `pandoc -H commands.tex ...` There can be multiple header files like this.
Re:LaTeX Makes Me Angry on Tuesday October 11, 2022 @05:13PM (#33169334)
I'd guess you have to first convert markdown to tex with --natbib flag, then compile the tex (assuming the input is input.md and you want input.tex at the output)

`pandoc -f markdown -t latex -o input.tex --natbib input.md`

It is perhaps not unexpected that the capabilities of such a simple thing as markdown are not too overwhelming. Pandoc does not extend markdown as a markup language, it can only convert markdown to pretty much whatever you want. If you have rather precise requirements such as natbib for citations, it may be better to start with latex right away.

I usually use pandoc to produce simple short documents. Occasionally I use it to do the peer review for journals, when from a single markdown source, pandoc builds me a plain text file with latex commands substituted with unicode symbols, and also a pdf.

This all can be simplified with pandocomatic (a thing that automates calls to pandoc) and entr (a thing that invokes a command upon file update).

In the simplest form, `ls input.md | entr pandoc -o output.pdf input.md` will call pandoc each time the file input.md is updated.

Re:LaTeX Makes Me Angry on Tuesday October 11, 2022 @05:32AM (#33161201)
Pandoc is a standalone application that converts between a huge variety of formats, including markdown to pdf, which means that you can write your plain text markdown in the editor of choice and then convert it to pdf using pandoc.

To use citations, the standard way is to use the `pandoc-citeproc` filter.

That's interesting, thanks. Out of curiosity, is there a guide to learn more about the German style?
Re:Chess.com vs. Lichess on Thursday December 16, 2021 @05:00AM (#29576713)
I think it deserves a separate mention: lichess has so much better clock UI. Their clock is big and very clearly visible both on desktop and mobile. It also goes red when you are low on time. Chess.com's clock is tiny and I saw some GM complaining on his stream about losing on time because he was unable to track his clock because of that.
I appreciate the unicode support.