Threads for gg

  1. 3

    This looks great. Many features I’d never thought of. I tend to read papers either on the iPad. I use Muse or the default PDF viewer, but especially finding references and navigating in general tends to be very disruptive. Does anyone have any suggestions of relevant software for the iPad?

    1. 2

      There ought to be some term like “neat sniping”. org-mode been it for me. I have made a deal with myself: Emacs is for code (fine: and email and IRC), but not for notes or TODOs. I deliberately use the least powerful tool for that. Slightly jealous of those who can make it work without getting side-tracked, though.

      That is one beautiful website BTW.

      1. 1

        Any time I try to replace even bog-standard, unconfigured org-mode with some other format/editor it feels like writing with a pen in your mouth. Sure, words get written but the experience is terrible.

        Emacs is for writing and reading text. Email, TODOs, anything text.

        – Sent from Emacs

      1. 15

        They’re not active streams, but on the Go YouTube channel there’s a video of Andrew Gerrand and Brad Fitzpatrick pair programming in Go. I think there’s at least one more. There’s also Russ Cox’s Advent of Code series, which has has about two hours of Go material, including an hour long and half hour long videos.

        1. 4

          The advent of code series from @rsc is great! Though it’s not quite “doing The Thing” as much as explaining a solution he’s already worked out.

          1. 1

            That’s true, but I think at least the hour long video was done without having a solution ahead of time? I haven’t watched it in full, but I’ve skipped around and it seems like he’s doing it off the cuff in that one.

        1. 15

          Mickey Petersen from Mastering Emacs does a fantastic job of annotating the detailed changelog.

          1. 9

            I also used Linux on the desktop for over a decade, and switched to macOS as a daily driver a few years back. I think the benefits of Finder and Preview are often overlooked, but they’ve got some great features for day-to-day use.

            • I love Quick Look: select a file in the Finder, then press space to see a preview. Tap space again and it disappears. It’s extensible, too; if you brew install qlmarkdown, you can preview Markdown files this way too.
              • Similarly, I like that renaming a file is just “enter”. You can rename a file while quick-looking – this sounds niche, but I do this all the time. (Peek at a bank statement PDF to find out the date, then rename it while it’s open.)
              • And it’s available in file picker windows too.
            • Well-behaved document-centric apps let you manage files within them, too. Click the filename to rename or move it to another folder. You can drag its icon off the title bar into other apps (such as the terminal). Right click the icon and click the folder to see the file in the Finder. (Some apps give you “reveal in Finder” in the File menu, and I wish that was standard everywhere, but it doesn’t seem to be.)
            • Preview isn’t just a document viewer – I use it a lot for annotating screenshots for work. It’s also great as a PDF editor – you can combine documents, remove pages, rearrange pages, and annotate them. I find myself using this a couple of times a month.
            • You can use Automator to write your own scripts. You can either run them ad-hoc (via right click → Services), or automatically via a folder action (whenever a file is added to the folder, the script runs automatically.)
            • This probably isn’t big enough for its own bullet, but you can batch-rename files (right click → Rename files…) to add text, replace text, and number them.

            None of this stuff is exciting, and it was all possible on Linux. There’s rough edges too – I don’t think the recent redesign is as usable (screenshot from this article with more comparisons). But in macOS these features are right there, work quickly, and feel well-thought-out. Got a mis-rotated image? Select it in Finder, tap space, click “rotate left” button, tap space again. Fixed! Similarly, being able to rename and move files from within a program makes a lot of sense to me. When you realise your document’s taken a swing from the original plan, you can update it immediately. I really like having these file management tools at my fingertips throughout the OS.

            1. 5

              Preview isn’t just a document viewer – I use it a lot for annotating screenshots for work. It’s also great as a PDF editor – you can combine documents, remove pages, rearrange pages, and annotate them. I find myself using this a couple of times a month.

              This was the feature that sold me on Mac when my wife was trying to convince me to get one. It’s just fantastic how you can select a few pages from a PDF, drag and drop them into a separate PDF and that’s it.

              1. 3

                It’s almost funny how dumb this sounds as a sellable feature, but when you do need it, it’s an absolute life changer. IIRC you can also automate this in Automator, select a bunch of PDFs (and order of selection matters) then it can create a single combined PDF using the Combine PDF Pages action (which can interleave pages instead of appending them). It’s also got things like extracting odd and even pages - I’m sure that’s extremely useful to someone; Recompress Images inside PDFs, Extract PDF Annotations, Add watermarks, etc. You could quite easily do a lot of the effort of wrangling files for a publishing workflow in a few minutes of playing with Automator - such an underrated feature. And I say this as someone who is very happy to reach for shell scripts to automate things, the richness of Automator is just not comparable to having to learn dozens of task specific tools. It is, in its own way, a very good implementation of the unix philosophy.

                Edit: I just had a look at the Developer section, and there’s quite a few actions in there for dealing with SQLite databases; crazy!

                1. 1

                  I’ll admit I haven’t searched well, but where would you go to learn about what actions are possible, and how to stitch them together?

                  I have a MacBook for work, and I am constantly amazed at how many things you’re supposed to just know. Wanna take a screenshot? Duh, it’s CMD + Ctrl + Shift + 4! Press the space bar if you want to screenshot a single window! [^1] Meta + click the “close” menu item for “force close”!

                  While definitely not in the same league, some of these Automator scripts I have come across online seem equally hard to discover. It’s not like these packages have manpages.

                  [^1]: these commands may or may not be correct - I have to discover them every time.

                  1. 1

                    where would you go to learn about what actions are possible, and how to stitch them together?

                    I don’t know if there’s a defined “learning path” for this; I think it’s a combination of playing around, reading things, chatting with friends, comment threads like these, etc. Having said that, macOS’ help system is also quite good! It’s available in every app, blends application support with OS support, and also locates menu items. For your screenshot example, opening the Help menu and typing “screenshot” opens this article (in a native app – open the sidebar for browsing the manual). That article has the keyboard shortcuts at the end.

                    • I’ve got cmd-ctrl-shift-4 burned into me too, as “capture a region and put it in my clipboard” is my main screenshot task. But the “standard” shortcut (which I didn’t know before!) is less finger-bendy: cmd-shift-5. That gives you a palette of options for picture/video and whole screen/window/region capture.
                    • You can also use cmd-space to open Spotlight and type “screenshot”, which is way less convenient but much easier to remember.

                    Meta + click the “close” menu item for “force close”!

                    I didn’t know that one! I’ve always used “Force quit” from the Apple menu.

                    1. 1

                      When it comes to Automator, you just open it up and read the documentation attached on each step that looks interesting to you, it’s all pretty “discoverable”. Poke around, see what’s there, file it away in the back of your mind for some day later where you need to automate something.

                2. 2

                  Quick Look is something that is so ingrained that I forgot to mention it. I wish Dolphin had that. Enter-to-rename is something you can do with Dolphin, I think? Maybe? I know that the “rename batch files” worked pretty well, about as well as Finder’s.

                  Preview is pretty powerful and showcases the power of the windowing system being based on Display PostScript – PDFs are basically just window objects. (I have no idea if there is an DPS code left in the Mac OS, but it sure was front-and-centre in NeXT.)

                1. 2

                  this quote from theo is often brought up when people talk about qubes os from a security perspective.

                  I don’t fancy myself in a position to make an assessment, but I suppose this has been validated somewhat by the recent malware targeting hypervisors

                  1. 2

                    I used KDE 3 way back in the day, to show off how pretty my Linux distro was, but full knowing I couldn’t afford it, hardware-wise. It looked amazing and was very functional. I installed version 5.xx a few weeks ago, coming from dwm, and was stunned by how well it works. It even made me want to use Konqueror to browse the web, but that part wasn’t so successful.

                    Now, one thing I don’t understand… is it called “Plasma” now? Is it no longer the Kool Desktop Environment? Or is Plasma a subset of KDE?

                    1. 4

                      A few years ago they changed the names of things. KDE is now an umbrella name of the organization, and Plasma is the desktop “by KDE”. So, Konqueror, for example is “a KDE app” because it’s written and maintained by KDE people, but it can run on desktops other than Plasma.

                    1. 4

                      This is great, the first time in a while that I read something about Nix and come out less confused than I was going in.

                      Flakes seems like a great tool. Normally, when I hear someone say they use Nix with $TOOL, my reaction is “I have a hard enough time figuring out Nix on its own, tyvm”. Why is Flakes its own thing? And what is experimental about it?

                      1. 16

                        I’m glad it had the effect I was going for :)

                        Flakes is a thing because the model that Nix uses kinda accidentally assumed that the whole world could be a part of nixpkgs. Turns out that’s sadly not the case, but this explains why external dependencies (such as random git repos such as my website’s source code) were never really considered as a core part of the model. Not to mention just giving people a .nix file to build the software is basically like giving someone a Dockerfile. A Dockerfile will get you to build the software yeah, but overall it doesn’t give you details on how to use it.

                        I believe that the main innovation with flakes is that it doesn’t just give you build instructions, but also it gives you a way to give out usage instructions with the software. This is the same way that a docker-compose.yml file gives you instructions on how to use stuff that is built with docker.

                        I’m pretty sure that flakes are still experimental because they want to get feedback about it and potentially make breaking changes to the implementation at some point. However, from my view the net improvements on giving more semantic information and direct ways to use things (eg: nix run github:Xe/gohello) are so great that this kind of thing really needs to be in the hands of more people. In my decision calculus it’s a case of the benefits outweighing the risks.

                        I’m going to use this style of teaching people how to Nix in the future. I think the next post is purely going to be on how to write Nix packages (and split up a bigger package into a few smaller ones) using way too many contrived Go programs as examples. I may also work in Xeact and Xess. IDK, still working out the formula. This is the kind of style that I’d like to use for a book on Nix/NixOS if I ever get my ADHD to let off enough to let me commit to a longer term project like that.

                        1. 4

                          To pivot off of the note there on nix run, I’ll give an example, nixpkgs doesn’t have htwatch yet (I might submit a pr for it who knows), but if you want to run it anywhere with nix, aka darwin/linux with nix you can run this:

                          nix run github:mitchty/nixos#hwatch -- -n 300 -N -d somecommandorwhatever

                          And It will build the same hwatch I am running at home now. I’m working on porting pikvm as well in that repo (i got side tracked so… don’t expect anything soon) but I love having nix flakes for a bit of a mini “personal nixpkgs” repo where I can test out experiments easily.

                          I do have gripes about some of this mostly with the command MUST be the same as the package name, which isn’t quite good when you’re testing out something that has a name like blahfs and has a subcommand blah.mount that you want to just test out but I just haven’t looked at how hard that is to do or not.

                      1. 4

                        I don’t listen to tech podcasts much, but @adamgordonbell consistently books the most fascinating people in tech.

                        I didn’t know he had a YouTube channel. Very interesting content

                        1. 4

                          Thanks for the praise and for listening!

                          Andreas’s youtube is great!

                        1. 3

                          Tangential and noob, but the discussion on a sibling thread made me wonder: how do smaller clients deal with cert revocation? Eg, curl? Since TLS is not restricted to browsers, I’d expect OSes to manage this by themselves on some layer. Is that correct? If so, is it desirable for browsers to duplicate those efforts?

                          I’m on my phone right now, but I’m pretty sure my local FF installation maintains its own list of root CAs. Come to think of it, I don’t know why…

                          1. 7

                            Most operating systems have a built-in root store that’s vetted by the operating system. Mozilla has its own root store and a root store policy, which is generally considered more restrictive and only used for HTTPS/WebPKI, whereas other OS root stores also have to deal with use cases like codesigning. Most clients rely on the OS root store, where Firefox does not (you can use some preference or an enterprise setting if you want to control your roots for your organization and make sure Firefox is aligned though). I actually do not know the exact backstory, but an overview of different OS root stores seems to be in this wikipedia article about CAs.

                            The root store is also a great service, such that most Linux distributions use a copy of the Mozilla certificate bundle, in Debian-based distributions, this is the “ca-certificates” package. I hope that answers some of your questions.

                            1. 4

                              This page on the Mozilla Wiki has busload of interesting links.

                              1. 2

                                The OS usually has a root store, but AFAIK none handle revocation. In many cases having a browser bundle certs is useful, especially if your device isn’t getting updates and you can’t manually update the system root store. (See the Let’s Encrypt issues with old Android, Firefox users were never affected though IIRC they did find some solution to avoid breaking other browsers.

                            1. 4

                              Pleased they got into the “human-style” strategies toward the end. One of my long-ago on-the-train projects was a sudoku solver that would use only human strategies and give you a list of moves (with their rationale) at the end. It’s a harder coding problem, but much more satisfying when it works. :)

                              1. 1

                                Sounds very tough. How far did you get on that? Is the code live anywhere?

                                To this day, one of the most impressive uses of tech in my opinion is Wolfram|Alpha circa 2010: I used their step-by-step integration countless times, never without thinking “how in the world did they do this”?

                                1. 1

                                  I’m too embarrassed to post unfinished 15-year-old code :), but it isn’t as tough as it sounds. Sudoku fans have names like “naked pair” for each strategy, so coding the logic for each strategy is straightforward once you understand it. The rest is deciding which order to try strategies (easiest first!) and saving each board state and the details of the move that got you there.

                                  I never finished but my goal was to have it solve an arbitrary puzzle, then rate the difficulty based on the maximum strategy required to solve it. I was/am 99% sure that sudoku puzzle generators have this same logic, so they can rate them as “easy”, “medium”, and so on.

                                  1. 1

                                    If you play Good Sudoku on iOS, it can give you hints by applying human strategies, like “you missed a naked single” or whatever. It’s pretty addictive.

                              1. 1

                                What happens when there are multiple teams on the same code base? Will things collide? Not rethorical, they might’ve already thought of this.

                                1. 2

                                  You can specify a suffix for the branch name. If you don’t, and two different teams target, say, master, I believe that would create chaos on mob/master (with two histories merged together). From the docs:

                                  Basic Commands(Options):
                                    start [<minutes>]                      Start a <minutes> timer
                                      [--branch|-b <branch-postfix>]       Set wip branch to 'mob/<base-branch>-<branch-postfix>'

                                  In my team, even code that is mob-programmed still has to go through formal code review, so I normally create an empty branch that will ultimately be used for the PR. Then, collaboration happens on mob/that_branch_name, which prevents conflicts neatly.

                                1. 1

                                  Great analysis.

                                  I don’t know Zig myself, but have been interested in it ever since a similar comparison with other language runtimes from @ddevault:

                                  Hello world.