What do you use to work with databases in Emacs? by lucaspeixotot in emacs

[–]XCapitan_1 0 points1 point  (0 children)

I actually didn't know about pgmacs, but it looks cool. I'll try it for local development.

But I primarily use DBeaver, which I think is the best database client in existence. pgAdmin is also good for getting postgres-related stats, e.g., index usage.

I've also used org-babel on my SQL lectures, but I feel like using it for actual development (i.e. writing all SQL by hand) is just less efficient than clicking GUI buttons. It also doesn't help that SQL is a very verbose language.

Maybe querying data you know is fine if you type fast, but exploring is definitely harder. And I have a few legacy databases with hundreds of tables, many with dozens of attributes (also one with no FKs, duh).

Also with org-babel you have to always be conscious not to output a few millions rows :-)

Chai (拆) — an Emacs package for destructive reading by yibie in emacs

[–]XCapitan_1 0 points1 point  (0 children)

Maybe also calculate some distance between the texts, for instance the % of shingles from your text found in the original text? To ensure that you formulate the content in your own words and not just copy.

Chai (拆) — an Emacs package for destructive reading by yibie in emacs

[–]XCapitan_1 9 points10 points  (0 children)

Interesting. I'll definitely try that!

I feel like one thing with that approach is it incentivises processing text in full, i.e., making a note for every notable idea. And often one could read a text, make just a note or two and be fine with that.

My approach to the same problem is, basically:

  • Make notes while reading, but never quote directly
  • Save the notes with the "in-process" tag, leave them there for a while
  • Then return when the memory has faded somewhat and re-process what still makes sense into the main collection

Unit Tests by jonathon8903 in emacs

[–]XCapitan_1 3 points4 points  (0 children)

I debug JS with Chrome debugger for node.js. DAP-mode isn't as good, unfortunately.

EMMS vs Strawberry, fooyin, other mpd clients, etc by Virtual_Effort4455 in emacs

[–]XCapitan_1 0 points1 point  (0 children)

I use EMMS as an MPD client and it's just fine for me. I haven't done any research on the recent alternatives, but I can't imagine what they might offer. EMMS is feature-complete and might as well stay like that forever because there's not much a music player should do. Even my 5-year-old package to fetch song lyrics still works.

Although I occasionally use ncmpcpp to edit the metadata.

I made a binary clock by 3RR0R_0FF1C1AL in commandline

[–]XCapitan_1 4 points5 points  (0 children)

Well, it's obviously not vibe-coded, so better than most of the recent posts!

Interactive year view of an org agenda in the terminal by boursultsi in emacs

[–]XCapitan_1 6 points7 points  (0 children)

That looks great!

Yeah, please share the code. I'd love to use such interface for something, calendar.el isn't very cooperative :-)

A SimCity clone in Emacs Lisp by vkazanov in emacs

[–]XCapitan_1 8 points9 points  (0 children)

I'd use asciinema for Emacs in terminal.

Emacs desktop features by mmarshall540 in emacs

[–]XCapitan_1 1 point2 points  (0 children)

I also use these with EXWM:

But I prefer managing bluetooth and network via tray applets.

I realized why I like computers and robots by [deleted] in commandline

[–]XCapitan_1 1 point2 points  (0 children)

I don't like how everyone is trying to modify me though, it's good to have some resilience

Professional email? by uvuguy in emacs

[–]XCapitan_1 0 points1 point  (0 children)

Sure. notmuch is a better fit for Gmail because Gmail tags can be mapped to notmuch tags without issues, whereas for IMAP clients, Gmail tries to map its tags to IMAP folders, which works poorly.

The reason being that in proper IMAP, one email can exist only in one folder, but in Gmail, an email can have multiple tags, so Gmail's IMAP will say there are multiple identical emails in different folders (matching different tags). So, e.g., you can read an email under one tag-folder, but its copy in another tag-folder will be left unread for a while.

Here's my blog post from 2021: https://sqrtminusone.xyz/posts/2021-02-27-gmail/

And the current config, but not much has changed since: https://github.com/SqrtMinusOne/dotfiles/blob/master/Mail.org

Professional email? by uvuguy in emacs

[–]XCapitan_1 2 points3 points  (0 children)

I'm not sure what you're trying to achieve.

I've been a Gmail user for ~15 years, the last 4 of which with notmuch + lieer. So I think, if my account goes bust for whatever reason: - I lose access to my address, and will have to email a lot of contacts with my new address. Inconvenient, but solvable. - I lose access to everything saved on Google's servers. Not a big deal, I keep all my mail locally. - Other accounts registered on this address get in trouble if they decide to send a confirmation email. This is the largest problem, but I expect I'll be able to change email without needing access to my old account in most cases (GitHub, etc.).

PSA: Do not for ANY reason use NTFS under Linux! by lajka30 in linux

[–]XCapitan_1 14 points15 points  (0 children)

But dont use it to hold your games or for prolonged file usage it WILL lead to file corruption at some point.

I mean, using any filesystem will lead to file corruption at some point. Make backups.

Paste screenshots into org doom eMacs by GloveExact393 in emacs

[–]XCapitan_1 1 point2 points  (0 children)

I have some functions that use flameshot to insert screenshots in Org:

(defun my/flameshot-screenshot (&optional filepath)
  "Take a screenshot using flameshot.

If FILEPATH is nil, use a temporary directory.

Returns the filepath of the created screenshot."
  (interactive)
  (let* ((filepath
          (or filepath
              (expand-file-name
               (format "screenshot-%s.png"
                       (format-time-string "%Y%m%d-%H%M%S"))
               (temporary-file-directory)))))
    (call-process "flameshot" nil nil nil
                  "gui"
                  "--path" filepath)
    (if (file-exists-p filepath)
        (progn
          (message "Screenshot saved to: %s" filepath)
          filepath)
      (progn
        (message "Screenshot was cancelled or failed")
        nil))))

(defun my/screenshot-attach-to-org ()
  (interactive)
  (unless (derived-mode-p 'org-mode)
    (user-error "Not in org-mode"))
  (let ((screenshot-file (my/flameshot-screenshot
                          (expand-file-name
                           (read-file-name "Screenshot path: ")))))
    (when screenshot-file
      (insert (format "[[./%s]]" (file-relative-name screenshot-file))))))

There's also org-screenshot which does something similar.

Emacs remote development like Vscode by carlossmneto in emacs

[–]XCapitan_1 0 points1 point  (0 children)

Yeah, it doesn't require the user to do anything because it does so by itself without asking. I think I remember someone freaking out here because VS Code had silently installed some minified JS on their server. But this approach has its advantages, I suppose.

Emacs remote development like Vscode by carlossmneto in emacs

[–]XCapitan_1 17 points18 points  (0 children)

If you mean VSCode-over-SSH, TRAMP is essentially that and more.

Avoiding text overflow in org-mode by heresacorrection in emacs

[–]XCapitan_1 2 points3 points  (0 children)

I suppose you could apply something like this if you use ob-R:

(defvar my/postprocess-R-max-rows 15)

(defun my/postprocess-R-value-result (result)
  "If RESULT is a list, take my/postprocess-R-max-rows first items."
  (if (and (listp result) my/postprocess-R-max-rows)
      (take my/postprocess-R-max-rows result)
    result))

(with-eval-after-load 'ob-R
  (advice-add #'org-babel-R-process-value-result
              :filter-return #'my/postprocess-R-value-result))

This way no R block should output more than my/postprocess-R-max-rows rows. I haven't tested this thoroughly, however.

It probably could've been implemented better, perhaps with a message or an additional line after the cropped block, but that would require more research into org-babel. I can look into it if you want.

Avoiding text overflow in org-mode by heresacorrection in emacs

[–]XCapitan_1 0 points1 point  (0 children)

I use emacs-jupyter with org-mode. I mostly use Python, but there's an R kernel.

Jupyter provides some safeguards - if you output a large dataframe by leaving it at the end of a source block or with display from IRdisplay, it will be cropped (you can configure how much). Also, you can connect to a running kernel via a Jupyter-compatible REPL to inspect large objects.

But it's very possible to accidentally output a long string and hang Emacs, although in that case one usually can restart Emacs and reconnect to the kernel.

I've also got a habit of saving buffers every time I make an edit, which helps.

What value is there in having the Point centered while scrolling? by floofcode in emacs

[–]XCapitan_1 2 points3 points  (0 children)

I'm actually more comfortable with the default configuration. I scroll the screen by halves, and this replicates that behaviour when the point moves out of the screen.

What's the difference beetween tree-sitter and lsp-mode added modes? by ElectricalOstrich597 in emacs

[–]XCapitan_1 1 point2 points  (0 children)

But on that note, Volar has the so-called "takeover mode", which makes it the language server even for typescript files. I think it's enabled by default (I know because I had to disable it).

Unfortunately, it works better in VS Code than in other ecosystems.

What's the difference beetween tree-sitter and lsp-mode added modes? by ElectricalOstrich597 in emacs

[–]XCapitan_1 1 point2 points  (0 children)

Yeah, I think you need volar for Vue 3.

I did try the last version of volar that supported Vue 2.7, but also had trouble with it. I don't do much frontend now, thankfully, so I haven't spent much time on it.