==========
== 0x2f ==
==========

dape.el and attaching to Node process

By default, dape.el’s `dape-configs` variable includes the `js-debug-node` and `js-debug-chrome` configurations. See https://github.com/svaante/dape/blob/4694a7323b6bb6747f072c4c1253d18cf07a113f/dape.el#L196-L231

However, those are meant to start a file you’re currently in in debug mode.

If you prefer to start your Node process somewhere else using node --inspect [myfile.js], the above two configurations won’t work. Thankfully, it’s easy to add such a configuration yourself - see (js-debug-attach ... at the bottom.

You can run it using M-x dape and typing in js-debug attach :port 9229. You have to provide the port because it’s not specified in the below `dape-configs` var, and dape allows you to add props before running a pre-made configuration. Make sure to set up the debugger adapter package: https://github.com/svaante/dape?tab=readme-ov-file#javascript---vscode-js-

Read more...

Problemy z implementacją GTFS w Białymstoku

Czasy odjazdów zdefiniowane w calendar_dates.txt zamiast w calendar.txt

Jak wiemy, dane GTFS dla Białostockiej Komunikacji Miejskiej są dostępne tutaj: https://komunikacja.bialystok.pl/cms/File/download/gtfs/google_transit.zip

Po pobraniu archiwum .zip i rozpakowaniu go, ukażą nam się pliki:

  • agency.txt
  • calendar_dates.txt
  • routes.txt
  • shapes.txt
  • stops.txt
  • stop_times.txt
  • trips.txt

W dokumentacji (link niżej do oryginału w j. ang.) GTFS jest zawarty opis tego, za co każdy z tych plików odpowiada.

https://gtfs.org/schedule/reference/#dataset-files

Zwróćmy uwagę, że calendar.txt nie ma w pobranym archiwum .zip, natomiast calendar_dates.txt jest. GTFS pozwala na taką sytuację - jak można przeczytać w https://gtfs.org/schedule/reference/#calendar_datestxt:

Read more...

Quickly switching default audio inputs/outputs with bemenu and Pulse Audio

I’ve been using the graphical pavucontrol program for switching inputs. I wanted to switch to something leaner.

I came up with the below script. It depends on:

  • pactl
  • jq - for parsing pactl JSON output
  • bemenu - you could probably use dmenu too

The rest should be included with your system.

Use the script like changeaudio.sh sink (audio output) or changeaudio.sh source (audio input)

#!/bin/bash
# Simple audio output/input switcher based on bemenu

DEVICE=$1

if [[ ! $DEVICE =~ (sink|source) ]]; then
    echo "Pass as argument either 'sink' (to change audio output) or 'source' (to change audio input)."
    exit 1
fi

pactl --format=json list $DEVICE\s | \
jq -r '.[] | "\(.index) \(.description)"' | \
bemenu -l -1 | \
awk '{print $1}' | \
xargs pactl set-default-$DEVICE

It’s cool that pactl added support for JSON output. Without it, the only option left would be to use the “indented blocks of data” default output format. I’ve seen people write Pyton parsers for it.

Read more...

Keyboards with integrated pointing devices

The following sections split the keyboards into categories.

“Multimedia keyboard”

These are always wireless. These are meant to be used in front of a TV. I don’t think programming on this would be comfortable.

There can be some stupid limitations, like the Logitech K400 has: the F1-F12 keys work as media keys by default, you can toggle them to work as regular F1-F12 keys, but that will reset once the keyboard’s power cycles - which is unusable for programming.

Read more...

Jak zapłacić w polskim sklepie w euro przelewem z mBanku do mBanku

Składałem zamówienie w polskim sklepie i tuż przed zamówieniem zorientowałem się, że zapomniałem zmienić waluty z euro na złotego. Nie chciało mi się usuwać koszyka i tworzyć zamówienia w złotym od nowa, więc zdecydowałem się na rzecz absurdalną: zapłacić w euro za zamówienie w polskim sklepie, z dostawą do Polski.

Przy zakupie w euro, sklep umożliwiał jedynie zapłatę ręcznym przelewem tradycyjnym. BLIK, karta itd. były tylko dla zamówień w złotych.

Read more...

Disorientation at home caused by poor ventilation

For 18 months now I’ve been getting this “oxygen hunger”, coupled with disorientation when at home. It’d just suddenly hit me for a while.

It seems like poor ventilation caused this.

Causing poor ventilation

  1. I caused poor ventilation after watching a video where it’s shown that you can turn a screw on the side of the window to make it seal better against the window frame. It’s sometimes called “window winter mode”. This made it easier to keep heat in the home, but also cuts off fresh air supply. I turned it all the way to max sealing on every window.

    Read more...

It sucks to be a forgetful citizen

Here I am, “citizen”, the person that’s supposed to keep the government in check.

But I am so forgetful. If a politician does something stupid and it’ shown on TV - and they do so many stupid things - there’s so much things to remember. So much, that the next day I unconciously forget about the whole thing.

My own forgetfulness was painful to me especially during the two govt. terms before 2023 in Poland. I know for a fact that there were criminal things happening. Just that … I can’t list them - I don’t remember them anymore. But they certainly deserved to be remembered, especially by a good citizen.

Read more...

"gio open" opening file in a different program than "gio mime [mimetypehere]" suggests

x-scheme-handler/file=emacs.desktop overrode everything.

The problem

Dino, my chat program, opens .webm in Emacs instead of MPV.

The diagnostics

Per https://github.com/dino/dino/issues/916#issuecomment-1006535011 looks like Dino uses the https://valadoc.org/gio-2.0/GLib.AppInfo.launch_default_for_uri.html method.

I think this means that I need to use gio instead of xdg-open when diagnosing any issues like this.

Anyways, I downloaded a sample file (webm) and saved it as test.webm

file test.webm --mime returned video/webm; charset=binary

gio mime video/webm returned

So if I run gio open test.webm, it should open in MPV right?

Read more...

Can't /ssh: into TrueNas SCALE root user with Emacs TRAMP

This is happening because TrueNAS’s root user runs a .zshrc file where PROMPT= is set to something that TRAMP doesn’t understand. While in an SSH session as root on the TrueNAS machine, make sure that you’re running zsh using echo $0, then open the file /root/.zshrc, comment out PROMPT​="%n@%m[%40<...<%~%<<]# " (fourth line from the top), save, and try connecting with TRAMP again.

Can't paste screenshots on IceCat browser

Whenever I screenshotted a region of my screen and put the image data into the clipboard, I noticed that I can’t paste the screenshot into my Mastodon posts. The culprit turned out to be the dom.events.clipboardevents.enabled Firefox pref in about:config. Make sure to set it to true and it’ll start working.

1 of 2 Next Page