Threads for adriangoransson

  1. 4

    Nice, didn’t know about the screen wake lock API before. Got me thinking about making a similar page where you can embed other sites too. I often have recipes open on my phone while cooking, and the constant need to unlock the phone is pretty frustrating. As far as I know, iOS has no way to temporarily disable the screen lock.

    1. 6

      The video’s don’t seem to work for me in Firefox on Linux: “no video with supported format and MIME type found”. This seems to be MP4, which should work. If I open one of the links directly I get “The video can’t be played because the file is corrupt”. In the console I have the error:

      Media resource [..] could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005)

      Details: mozilla::SupportChecker::AddMediaFormatChecker(const mozilla::TrackInfo&)::<lambda()>: Decoder may not have the capability to handle the requested video format with YUV444 chroma subsampling.

      Playing it with mpv works, and confirms it uses YUV444. It looks like Firefox doesn’t support this for MP4 files:

      While ffmpeg can decode them, neither windows WMF decoder nor Apple’s one can.
      For coonsistency sake, we’ve disabled them on Linux too.

      If you want to play yuv444 video, prefer a free codec such as vp9 for which we can provide decoder.

      Anyway, just FYI :-)

      All of that being said, I often find just a piece of text with example commands a lot easier than videos, as they don’t move so much and I can adsorb it in my own time (“what did it type? Oh, now it’s gone”)

      1. 2

        Thanks for digging into this. I ran into it and was just going to complain that the videos weren’t working for me without bothering to troubleshoot. I’ve seen the problem a half dozen times and chalked it up to a poor video hosting site in the past.

        Now that I know this, I installed ff2mpv’s native messaging host (yay -S ff2mpv-native-messaging-host-git) followed by this add-on and now have a right-click option to play these in mpv with even less fuss.

        1. 1

          Oh jeez. Adding videos to the website is a pain in the ass Sorry, my bad. Should have just gone with pure GIFs ig?

          All of that being said, I often find just a piece of text with example commands a lot easier than videos, as they don’t move so much and I can adsorb it in my own time (“what did it type? Oh, now it’s gone”)

          I see thanks, wanted it to be interactive so that I could demonstrate how the workflow will change if you mess up git

          1. 3

            Have you checked out asciinema? Less of a hassle than either videos or gifs I would imagine.

            1. 1

              GIFs can be kinda large.

              I’m not sure what the best codecs to use is; I never really added videos to a webpage so I never looked at it; I just noticed it didn’t work 😅 I’m sure there are some guides out there, and as mentioned asciinema is quite nice as well.

          1. 6

            I’m quite happy with the neo-dark lobsters userstyle.

            Install the Stylus addon to use it, Stylish is bad.

            Screenshot: https://i.imgur.com/Iyu9sDM.png

            1. 2

              This Stylus addon is awesome. Thanks for the hint. I’m pretty sure that I’m going to use it quite a lot (just made lobste.rs dark for me).

              1. 2

                Stylus is pretty awesome, I’m using it to hide unneeded elements on web sites I visit often. Don’t like this bar on the top? Hide it. uBlock hides the ads, but leaves the empty space that is left unused? Hide it. Lobsters doesn’t have a dark mode? It’s just a few CSS rules and dark mode it is. HN doesn’t have dark mode? Add a bunch of other CSS rules. Don’t like this font? Change it by using 2 lines of CSS.

                1. 5

                  FYI, ublock origin has element pickers as well to hide custom elements. Either temporarily (“zap”) or by creating rules.

              1. 11

                I haven’t desired an OS war debate since about 2005. I understand that this isn’t fair since I’m probably laying down kindling and not asking for a flame war.

                I would switch much faster if I had iTerm2 (don’t say tmux, alacritty unless they are 1:1) and a few other tools. I’ve run Gentoo as my main machine and many Linux-es in the past (all I can do for street cred folks). Xcode, the app store, economics or something else apparently just makes high quality UIs possible because it’s not the same? Monodraw, Alfred, Pixelmator and a few others. There are a few I could budge on. The Mac apps are very polished, fonts are the best and usually the UX is good (iTerm’s options boxes are kind of insane). I keep flirting with the idea but then I make a list of stuff I’d miss.

                Linux has upsides too. It’s really what I want, a Unix box. I could ditch tiling window manager clones or near-misses and get a full-on tiled thing going (of course the browser kinda of kinks the terminal based flow but whatever). That’s not my issue. My issue is that Linux is great on the server. Linux (unix) excels at text but its desktop and GUI layer has always been weird. I don’t want it to be like this. If Electron was magically as fast as QT (etc) and made it easy to layout GUIs like Xcode, maybe that would be it? I just don’t know what the issues are in the GUI space. Armchair analyst mode though: people pay for mac software.

                This just continues to be true: computers suck, macs suck the least. But everything can change with time.

                1. 6

                  I’m not a fan of tmux and alacritty either but found kitty to be a great cross platform alternative to iTerm. At least if it’s the panes and tabs that you want.

                  Much more pleasant configuration too if you like to keep clean dotfiles.

                  1. 2

                    What does iTerm2 do that’s not in something like gnome-terminal?

                    I use both and I’d like to know about any cool features I’m missing in iTerm2.

                    They look the same to me from my Linux accustomed experience, what am I missing?

                    1. 2

                      Does anything else have “native tmux” yet? That is, tmux windows/panes are just iTerm windows/panes—you don’t need to do any tmux key commands at all. Makes persistent server sessions very nice. I believe the iTerm author implemented the protocol for this in tmux but I’m not sure if any other emulator has adopted it.

                      1. 1

                        iTerm has more customization knobs than gnome-terminal (or any other Terminal emulator I’ve used) by an order of magnitude.

                        1. 1

                          Same, would love to know what I was missing from iTerm2. I don’t use tmux integration, not sure about other cools features that I missed. But one thing I noticed is it’s significant slower thang the default terminal application.

                          1. 1

                            Good question so I’ll do my best. Most of this is taste but I hope I can explain a feeling.

                            1. The hotkeys are nice (to me). They are quicker than leaders and are basically the same as Chrome tabs. Cmd+T for new tab, Cmd+Alt+Arrows. And of course mac apps flash the menu item and have hints next to them. But that’s iTerm leveraging MacOS.
                            2. The pane splitting is easy. Moving panes is easy. Moving panes to windows or the opposite, easy-ish.
                            3. Broadcasting input to all tabs is neat (but rarely used). Tmux does this too.
                            4. The fonts look nice (because MacOS). I’m sure other terminals have 256-color and image support. iTerm was early on this (to me). Powerline fonts, all the fluff.
                            5. The fullscreen has native and non-native options, so it’s quick and has survived the Apple OS changes.
                            6. I use a global hotkey for a dev log described here.
                            7. You can temp fullscreen a pane with shift+Cmd+enter. It has an overlay telling you you are in this mode.
                            8. Like someone said, the customizations are great. Just one example: you can dim panes on unfocus to your liking. Even not graphics dimming, font color dimming. It’s great.
                            9. The tmux stuff is neat, a bit weird (root window has to stay open). Haven’t used it a lot.

                            I’ve tried the windows options. Putty (not the same thing) hasn’t changed in decades. ConEmu or Hyper is close. Hyper is a bit slow (maybe things have changed). ConEmu is close with WSL. But I’m biased because of muscle memory!

                            Sorry, getting off-topic. Back to the OP, I agree in the sentiment. I’m spooked by the changes. It’s consumer facing more and more. But I don’t know if any of these things are nails in the coffin or the community will continue to workaround/adapt. There have been breaking changes on major OS versions for a long time. People working sometimes wait when they optimize for stability. But, OP, I hear you. 🌻

                          2. 2

                            Yeah, it’s only a matter of time. After a recent upgrade of iTerm2 my whole screen would periodically flicker wildly. Occasionally my machine (2019 Pro) would reboot. I temporarily downgraded to Terminal, and everything settled down. My text mode apps also seemed snappier. My lesson from all this: to always be on the lookout for costs when things change. Even when the change seems pleasant (timestamps on specific lines in iTerm2, tmux integration, lots of other lovely stuff). Because we suck at changing things at scale without regression.

                            1. 2

                              I agree with this. And your description of Linux feeling different from macOS, at least in terms of GUIs, reminds me of this blog entry: https://blogs.gnome.org/tbernard/2019/12/04/there-is-no-linux-platform-1 IMO, to make a Linux computer feel like a real Unix desktop you need a controlling entity to smooth over the edges. Like Android or Chrome OS or even Raspberry Pi OS. Of course, purists would say “this isn’t the GNU/Linux I know”. They’d be right. But from what I can tell, we don’t even have that option.

                            1. 2

                              Great work Svelte team! I’ve been excited about Svelte for a while. The blog (that sadly has been idle for a year up until now) and the integrated playground is excellent. But I’ve become so used to statically typed languages elsewhere that writing Javascript feels weird almost. Can’t wait to try this (and Typescript) out finally.

                              1. 6

                                I was wondering for a good minute if the article was broken (I could not scroll) before I realised that it’s a set of slides. Modern fullpage title backgrounds like Medium have broken me.

                                1. 3

                                  Interesting article! I’m in a similar situation as the author, pre-switch, with an MBP as my main computer for the last 7 years. It’s a fantastic piece of hardware and has held up extremely well considering it was the base model. It’s only lately when I tried to run Android Studio that I felt it to be lacking in performance.

                                  While I like macOS, I’m getting rather tired of it, having to keep up with ways to customize or revert with every release. I’ve also grown tired of Homebrew, mostly because it’s really slow. Recently, I got my hands on an old desktop machine and decided to try out Void linux which impressed me greatly from the package management to the simple configuration. No more (forced) hand holding!

                                  Recent Apple hardware like the touch bar doesn’t appeal to me either, but what I appreciate is their commitment to great displays. I’m stunned to see that Full HD is still the norm with the competition and upping the resolution is often only available with a touchscreen display that I’m not willing to pay for. I’ve mostly been eyeing Lenovo and Dell, the latter of which introduced what seemed to be the perfect macbook-killer last year. Sadly that specific model (or configuration of it) was not available in Sweden.

                                  1. 3

                                    This may be the most stupid thing ever but I just don’t use Firefox more because it doesn’t support macOS dark mode natively. There’s a bug on bugzilla opened 2 years ago and still no action was taken. In addition to that, I think Firefox has some unnecessary features. Even Chrome feels cleaner right after installing. Despite all of that, I like Mozilla’s support of the decentralized web and their take on extensions.

                                    1. 3

                                      What’s missing exactly? The default* theme has automatic dark mode and web pages with the correct CSS work perfectly fine as well.

                                      * sadly, it seems to be the only one. Though it can be modified with userchrome.css

                                      1. 2

                                        The native UIs (context menu, save, other dialogs) all use the light theme from macOS. It kinda feels out of place, you know? All other applications I use fit well into the operating system but Firefox (https://imgur.com/a/T5WkXbw). I believe it’s just a matter of using the latest SDK and updating a line on the plist file. At least according to what I’ve read.

                                        1. 3

                                          Oh! I’m suprised to say I’ve never noticed that. Now I guess it’ll irk me until it’s fixed.

                                          1. 2

                                            Once you see it, you can’t unsee it! 😂

                                    1. 4

                                      Nice! I also made my own static site generate which uses KaTeX instead of hevea to render LaTeX to static HTML: https://github.com/rubenvannieuwpoort/static-site-generator

                                      It’s a bit more heavy-handed (as in: it outputs a lot of HTML elements to format relatively simple formulae), but the math it generates is really beatiful, and since I don’t put all of my posts on one page, my requirements are probably a little bit different.

                                      See also my blog, which is generated with my static site generator: https://rubenvannieuwpoort.nl

                                      This blog is a gem, by the way.

                                      1. 1

                                        The op mentions hevea being quite slow. How is server side rendered KaTeX in this regard?

                                        And I love the overall look of your posts!

                                        1. 3

                                          Thanks :)

                                          To be honest, it’s not terribly fast either. Currently, the blog has 7 posts, none of which are very long. This site takes 5 seconds to generate, which is not very slow. I think KaTeX takes the majority of the time, since there’s not too much else going on. It’s fair when you check the HTML, since the formulae consist of hundreds of DOM nodes.

                                          So, everything comes at a price. For me, this is acceptable since I don’t put all posts on one page. I don’t think it would be an acceptable solution for the blog in this thread since it would likely make loading/rendering the blog very slow.

                                      1. 3

                                        Interesting post! I’ve been trying out github actions to build TeX files and commit the compiled pdf before but never got it working. Got stuck even before any token issues because I found the build environment very difficult to work with and slow to debug.

                                        1. 2
                                          1. 1

                                            This looks very similar to Overleaf that I’m currently using. The problem with Overleaf is that exporting a PDF isn’t easily automated. Is Latexbase different?

                                            1. 1

                                              I don’t know about automating, I just manually do it

                                          2. 2

                                            I have ended up doing almost everything inside of a Docker container and just using their build environment to host the container. This makes debugging a whole lot easier since, if I really want to, I can even drop into a shell inside the container running locally and poke around.

                                            1. 1

                                              I tried using docker too (This image I believe) to no avail. Do you have any image recommendation or an example build config on Github?

                                              Thanks!

                                              1. 2

                                                Here’s an example. It’s still a work-in-progress, but basically I create my own images (see the Dockerfile) so I get exactly the packages I need and I can actually make the CI environment look more or less like the development environment. Then I run everything inside a container using the same Makefile targets that I would use during development. This isn’t a silver bullet, by any means, but it seems to work out reasonably well for my use-cases so far.

                                                https://github.com/TravisWheelerLab/NINJA/tree/avx

                                          1. 2

                                            Are there software libraries for people who want to get the same kinds of analytics Google Analytics does, except from their logs?

                                            1. 2

                                              Assuming you read the article, what kind of analytics are you missing? The article mentions GoAccess that should be able to extract the most common metrics (accessible in logs that is).

                                              1. 3

                                                Ah, I skimmed the article and somehow ended up thinking GoAccess was the author’s company or library. Thanks!