1. 15

    Destroying the notion of “fighting the compiler” was one of my biggest steps forward. I started to view the type checker as a pair programming buddy. One that doesn’t get tired, only states facts based on information it has, and will always update its assumptions based on new information, unlike most of us. ;)

    So basically “type systems”, but only after a necessary perspective shift. Well, that and being exposed to what modern type systems can actually do. Instead of the limited assumption that they only catch errors like: “That’s not an Int!”.

    1. 2

      As someone building extremely complex, scientific systems in Pythonthis. Seriously, type systems are so undervalued.

      1. 2

        Python 3.x doesn’t have type hints/annotations?

        1. 1

          It does! But it’s not a full replacement for a static/strong typing system, but it does help. We’re also pinned to an older version of Python (3.5) which doesn’t have full support for type hinting.

          1. 2

            I’ve been porting a large Python 2.x code-base to Python 3. Adding type annotations (https://mypy.readthedocs.io/en/stable/cheat_sheet.html) has been hugely helpful. The type system is quite expressive and mypy’s reporting is pretty good. After spending some time with Rust – which i really like – I appreciate the flexibility of Python’s approach.

            1. 2

              I’m a Java developer working with Python to automate some things. It seems like when the program is more than a few lines of code (1K) and needs to be maintained by a team, the desire for type systems grows strong.

      1. 1

        Wow. I’ve been using hammerspoon for a few years, but today I learned about URLDispatcher. That’s going to save me so many browser tabs with Zoom meetings!

        1. 2

          this specific use case was my exact motivation for heading down this path.

          1. 2

            I set it up yesterday and already it’s saved me whole minutes! Thanks for figuring out the chrome profile selection logic, that works like a charm (:

            1. 2

              minutes! pay it forward :-)

        1. 4

          (responding to myself) – and after searching a bit more I find this – https://github.com/agzam/spacehammer which is amazing if a bit more complex to understand.

          1. 1

            Never heard of Hammerspoon before. This is great! Thanks for sharing. Also go fennel-lang!

          1. 1

            What (web) apps for browser and Android are you using?

            1. 2

              There are a couple great RSS feed readers for Android in the F-droid ‘store’ that I use/used in the past: Feeder, Handy News Reader. My current favorite is Handy, since it allows you to download the entire article, which works pretty well in most cases.

              1. 2

                I use Newsblur. It’s open source and can be self hosted, but I just use the hosted one because I am lazy. They have an Android app which is quite good, although nothing flashy.

                I used to sync feeds locally with newsboat among others, but it would just take too long with hundreds of them. It really sucks on low bandwidth so I much prefer having a server now.

                1. 1

                  I use https://wiki.archlinux.org/index.php/Rss2email and email feed updates to myself. My email is the only “rss reader” that makes it easy to read feeds from mobile, emacs, web browser, etc, without a bunch of additional setup work and (flaky) synchronization

                  1. 1

                    I’ve been using Inoreader both on web and Android for the last two weeks for most feeds. So far so good. For feeds where I just want some bits and pieces occasionally, I add them to Flipboard and let the algorithms choose what to show me.

                    1. 1

                      Read all the reply and setup feed2toot (https://gitlab.com/chaica/feed2toot/) to get RSS in my fedi timeline.

                    1. 3

                      Love RSS too. Pro-tip for Flipboard – any feed you can read in in a web browser will have an RSS feed – just add /rss to the end. E.g. https://flipboard.com/@dzc/flipbooks-mc76pk0fy has https://flipboard.com/@dzc/flipbooks-mc76pk0fy/rss

                      1. 4

                        I like GNU stow. A lot. One of the things I like about it is that if I edit the config file using whatever the usual mechanism is for the app, it shows up in my dotfiles repo as a change that needs to be resolved. I don’t think that would happen (organically) with a copy based system.

                        The one thing I wish GNU stow could do is merge different sources of truth for a single target. By that I mean, I might want to keep most of my config data in a single repo for all my systems, and have a second repo that’s machine-specific that gets merged in somehow.

                        Does jann have an answer for either of these? i.e. if I edit ~/.config/kitty/kitty.conf using my text editor, will jann detect that and show me that I need to sync it to my dotfiles repo? And does it offer some way to have system-specific mods to my main dotfiles?

                        (I hope neither question sounds pointed… they are absolutely not meant that way… the right answer to the second one might make me want to switch if the answer to the first is livable.)

                        1. 4

                          I built my own tool to solve these problems as well – https://github.com/dcreemer/wsup ; it uses the concept of layers – I add my generic personal dotfiles on most hosts, then add in a couple layers for machine or project specific configs. All files are symlinked back to the layer git repo.

                          1. 1

                            This is a nice project. Forgive me if I’m not reading this right, but am I right in saying that as it the directory structure of the dotfile repo(s) needs to match the structure of your home directory? I must admit that was one of the reasons I disliked GNU Stow.

                            1. 1

                              Yes, you are correct. I wanted each “layer” to be a mirror of the home directory structure for ease of understanding. In this way, my “personal-private” layer can include files from ~/.ssh/ as can my “work1-private” layer. They both integrate into the “real” ~/.ssh/ directory.

                            2. 1

                              I like that scheme. Nice. Thanks for posting that. I’m tempted to adapt it to sit on top of stow.

                              1. 2

                                I would love that, and be happy to help out.

                            3. 2

                              The one thing I wish GNU stow could do is merge different sources of truth for a single target. By that I mean, I might want to keep most of my config data in a single repo for all my systems, and have a second repo that’s machine-specific that gets merged in somehow.

                              yadm offers machine-specific files. It doesn’t provide a templating or inclusion system, but I don’t often need one.

                              1. 2

                                that was exactly the motivating factor for https://github.com/dcreemer/wsup .

                                1. 1

                                  That looks really interesting. Thanks for the pointer.

                                2. 1

                                  I’m kinda starting to work on Yet Another™ “Dotfiles Manager” (though I want to use it to manage whole machines eventually, kinda poor man’s NixOS-inspired way). A crucial for me feature is that it should detect any changes between previous “deploy” and the current one, clearly show the diffs, and only be able to re-deploy after they’re resolved (it’s going to be copy-based).

                                  I wanted to use CUE as the config language, but it showed up to be somewhat too early-stage for my liking (mainly through poor error messages), so now I intend to use Lua instead (which I know pretty well). You’re welcome to watch the repo if only for releases if you like, though usual disclaimer that I don’t promise any kind of a timeline/ETA.

                                  1. 1

                                    Thanks for your interest in the project :-)

                                    if I edit ~/.config/kitty/kitty.conf using my text editor, will jann detect that and show me that I need to sync it to my dotfiles repo

                                    jann does not have this feature. That said, some sort of jann --diff might be a really good addition. I must admit, since I edit virtually all the dotfiles that matter to me from a text-editor, I had not considered the case of application-modified files.

                                    And does it offer some way to have system-specific mods to my main dotfiles?

                                    No, but I want it to in the future. I have thought quite a lot about introducing some sort of patch-based system to jann to allow this sort of functionality, but it’s not present at the moment (I would really like any suggestions anyone has on how to do this elegantly!). A lot of applications offer the option to put multiple config files in a /config.d/ directory - so for Sway, I put my machine specific config in there, and just let jann manage the main config. Another more hacky, but workable solution, would be something like the following (note the slightly confusing paths are because jann enters a ./deploy directory when it executes - I may in future pre-populate the symbol table with BUNDLE and DEPLOY global variables to make this sort of scripting more readable).

                                    Edit: I have added the BUNDLE variable. DEPLOY is a little more complicated for technical reasons.

                                    deploy {
                                        $ cat {{BUNDLE}}/general.config ~/setup/machine.config > specific.config
                                        deploy/specific.config >> ~/.config/app/config
                                    }
                                    
                                    1. 2

                                      I don’t know much about rust and its ecosystem, so just dismiss me if I’m suggesting something that doesn’t fit the model you’re working with. But I’ve been tempted before to solve the problem using some templating engine. (ecosystem aside, after that, I start to feel like I’m rewriting puppet and slink back into my symlink-laden cave.)

                                      1. 2

                                        Rust does, from what I understand, have some decent templating libraries. I know there is one that is a rough port of jinja which is rather nice. However, were I to implement templating - which sounds like it could be a worthwhile avenue - I would probably do it myself. Yes, I know that’s NIH syndrome, but it’s something I would enjoy doing and I’d be lying if I said that 40% of the reason for building jann wasn’t just a desire to write another parser :-)

                                        Your comment about Puppet is very amusing to me, because another significant part of the reason why I built jann was being intimidated by Puppet, Ansible, et. al. The prospect of installing a huge program with the website tagline ‘DevOps automation for a multi-cloud world’ to manage a dozen text files on my laptop seemed a textbook case of cracking a nut with a hundred-tonne steam hammer! I am eager to ensure that jann strikes a good balance between covering people’s use-cases and remaining a small, reasonably elegant binary that ‘does one thing well’.

                                        1. 1

                                          The idea of avoiding “(XYZ overkill thing) to manage a dozen text files on my laptop” resonates. I think I occupy an odd middle zone in what I want from this kind of utility.

                                          Mostly because my dozen config files are used in different ways across the three relatively disposable laptops I have to touch regularly. There’s my “daily driver” thinkpad, my “I need to mod my iOS app on the road” macbook and my “I need to cross a foreign border or go someplace it’ll probably get stolen” 10 year-old thinkpad with almost no personal data on it.

                                          I want slightly different dots for all of these :)

                                        2. 1

                                          chezmoi has templating for configs that differ between machines; sounds like it might fulfill your requirements. I only started using it recently as a replacement for my manually-managed symlinks but like it so far.

                                    1. 1

                                      In the article, the author included a picture with his login cookies digitally blacked out. Just an FYI if you ever do this, certain image formats like bitmap can trivially remove the black mark while keeping the data it’s obfuscating intact. Look up bitmap watermarking if you want to know more!

                                      1. 2

                                        Minor suggested edit: “s/his/her”

                                        1. 1

                                          Oops, thanks, but too late unfortunately

                                        2. 2

                                          Ok, I looked up “bitmap watermarking”, and found nothing but articles on how to add watermarks to bitmap images. What exactly are you referring to?

                                          1. 1

                                            Specifically, bitmaps aren’t compressed, and typically colors are stored in an 8 bit pixel. You can mask the least significant bit, or bits, and easily hide an image inside of another image with no visible detection.

                                          2. 1

                                            Surely no one does it this way though? You just open the image in a photo editor, paintbrush over the top, export the result.

                                            1. 1

                                              Yeah most people use compressed formats, but it’s something to be wary of if you are posting credentials online. And with PDFs many programs let you draw over the pdf if you want to hide specific info, but when you open that pdf somewhere else, the drawing is gone. This isn’t something to do with bitmaps, but something worth noting.

                                          1. 47

                                            keep your existing email account

                                            make a new email account with whatever service provider you want

                                            sign up for new accounts with your new email

                                            whenever you have to log in to an existing service with your current email, if you have time, switch it to your new email

                                            repeat until in a couple years everything is eventually switched over to your new one

                                            1. 20

                                              This. No need to delete your gmail account.

                                              I moved to Fastmail a year ago, and have been happy with it.

                                              Everytime I get an email on gmail, I spend a few minutes updating the email in whatever service sent me.

                                              The reason for not deleting is: There are emails you might only get once a year, like from the tax guys, MOT/TV license (here in the UK). You might have to react quickly, and sometimes its just easier to reply from gmail, and update the address later

                                              1. 6

                                                Not to mention missed opportunities with people that only know your Gmail account.

                                                1. 2

                                                  Absolutely agree with this. I switched to Fastmail with my own domain something like 5 years ago and I still have my Gmail address. I have it set to forward to my “new” address, as well, so that I don’t even have to log in to Gmail. When I noticed that an email I care about originally came into my Gmail address I update it (or tell the person who sent it).

                                                2. 7

                                                  One missed step: Set up forwarding rule from old account to new account.

                                                  1. 7

                                                    Great advice. I was going to say this, but was pleasantly surprised to find it was already the top response. I will add: Your old account is still attack surface for anything that’s linked to it. Don’t get lax on the security just because you no longer use it every day.

                                                    With gmail, if you delete your account, nobody else can ever register that username. This is a very important precaution since it prevents people from impersonating you. It is not necessarily the case with other email services. So, if you are applying this advice to migrate away from a mail service that isn’t gmail, look into whether it has that protection. If not, strongly consider never deleting the account.

                                                    1. 7

                                                      This is exactly what I did, though in addition I forwarded by gmail to my new address.

                                                      1. 3

                                                        Excellent advice. I also used this opportunity to migrate to a password manager, and ensure that I have updated, unique passwords everywhere.

                                                        1. 1

                                                          Same that I did, I moved to protonmail and just check my gmail once in a blue moon at this point in case someone forgot I had updated it. I’ve had my gmail since the early invite-only beta days and it gets bombarded with spam and garbage almost constantly as well as a lot of people using my email address to sign up for things in the states that apparently don’t do email verification…

                                                          I also used to get emails addressed to someone working at NVidia, got a medical insurance claim form at one point I think, as well as an invite to a wedding…

                                                          1. 2

                                                            Did you go to the wedding?

                                                            1. 1

                                                              No. But I did reply to the invite saying o wouldn’t be able to make it.

                                                          2. 1

                                                            I’ve been doing this, along with having Gmail forward all my email to my new account. I did that so I’d have copies of all my emails. I also did a dump and then import of all my previous emails too.

                                                            Honestly, it’s been fine. I’ve also unsubscribed from a lot of things and deleted a few accounts.

                                                          1. 1

                                                            Like may of us, I built my own (git-based) solution for this as well – WSUP. In my case, I have several computers, and change to new ones fairly often. I wanted version controlled dotfiles, with the ability to install different “layers” depending on the use or sharing needs. I have a layer for work, one for personal configs, one for just emacs, one for private files, etc.

                                                            1. 1

                                                              This is great – thanks! Gives me lots of ideas!

                                                              1. 2

                                                                This is an excellent article: clear, thorough, and directly applicable. Thanks for sharing it.

                                                                1. 1

                                                                  As others have mentioned, Emacs + org-mode + Orgzly can work (and is what I use).

                                                                  I’ve also heard nice things about Notion .

                                                                  1. 25

                                                                    I do this with Emacs and org-mode. I have one dedicated file - journal.org, and I create an entry per day. Despite ‘setup’ and configuration costs (which isn’t really that bad if you look at getting started with Spacemacs or Doom-Emacs), I’ve yet to come across anything that’s as frictionless whilst at the same time retaining the ultimate in flexibility.

                                                                    It might be worth a look at org-journal, but personally I’ve found the above to be pretty much all I need.

                                                                    1. 7

                                                                      Another +1 for org-mode. I keep an inbox.org that has a top level heading for each day. So it might look something like this.

                                                                      * March 19 - Tuesday
                                                                      ** 1:1 w/ boss
                                                                       - some 1:1 notes
                                                                       - more notes
                                                                      *** TODO a task from the 1:1
                                                                      ** A coding task [ 0 / 3 ]
                                                                      - [ ] write the code
                                                                      - [ ] write the tests
                                                                      - [ ] make a PR
                                                                      

                                                                      org-mode has built in tools to manage the TODO items and the checkboxes for you. You can pull a list of all todos, or see what things were checked off what days. The check boxes give a nice overview when the subtasks are folded. All of this gets folded up by org-mode so I can see a nice summary of the day without needing to dig into each sub item.

                                                                      1. 3

                                                                        org-mode has built in tools to manage the TODO items and the checkboxes for you.

                                                                        The dates, too: ‘C-c .’ AKA ‘org-time-stamp’ inserts <2019-03-19 Tue> and S-leftarrow goes back one day, etc.

                                                                        1. 2

                                                                          I do this exact same thing. One top-level item for each day.

                                                                        2. 4

                                                                          Same here with org-mode, but I also have a capture template that allows me to create a journal entry from anywhere with very little effort.

                                                                          The following in my emacs config file allows me to type C-c c j to open a buffer where I can record my entry, which then gets saved to ~/org/journal.org under the Journal heading.

                                                                          (global-set-key (kbd "C-c c") 'org-capture)
                                                                           (setq org-capture-templates
                                                                                 '(("j" "Journal" entry (file+olp+datetree "~/org/journal.org" "Journal")
                                                                                    "* %?\n  %i\n  %a\n")))
                                                                          

                                                                          Emacs capture templates

                                                                          1. 2

                                                                            I do this as well. I have a file: labbook.org with one entry per day. For me I was getting lost trying to come up with good methods of organizing my content (todo.org, $project.org, $person.org) and finally decided to simplify with chronological ordering.

                                                                            1. 1

                                                                              If you’re an emacs person org-mode is hard to beat. It’s outlining features are without peer near as I can tell. It’s one of the things I miss about emacs.

                                                                              1. 2

                                                                                Even if you don’t use Emacs for anything else, what stops you from using it for Org? Your comment reads a bit to me like “If you’re a Java person, Minecraft is a pretty fun game”.

                                                                                1. 1

                                                                                  Because I came to realize that much of Org’s power, much like the rest of emacs’s power, is more than I need and ends up being a bright shiny distraction that I end up futzing with endlessly rather than actually getting work done :)

                                                                                  Plain old Markdown files have served me very well for work stuff, and Evernote for personal stuff.

                                                                            1. 0

                                                                              ugly keyboard

                                                                              similar raspberry pi as developer machine ;) not for normal working.

                                                                              Good keyboard have psion https://jm.iq.pl/psion-5mx-z-linuxem-na-pokladzie/ but too slow processor. Meybe in future when folding screen will be popular

                                                                              1. 1

                                                                                Do you know about the Gemeni and Cosmo from Planet Computers ? I’d love to see one up close.

                                                                                1. 1

                                                                                  yes, and GOLE1 and similar I’m from Poland I need AltGr key for my language chars. Gemini,cosmo planet not have

                                                                                  This is very ugly keyboard for non latin writers (developers too) Ideal keyboard = https://klawiatura.wordpress.com/ ;) but is too big for me

                                                                              1. 2

                                                                                Thanks for the excellent write-up. In case anyone else needs it, Gitlab offers a free easy to use docker container registry that I have found convenient for a similar application.

                                                                                1. 1

                                                                                  How did you make use of this?

                                                                                  1. 1

                                                                                    I built alpine-based docker images for a few websites, then pushed to the authenticated Gitlab docker registry. On the target host I had simple automation to docker pull the images & start the containers. Very much like the main article.

                                                                                    1. 1

                                                                                      Ah neat. Do you know about Docker Machine? I’m curious how people who are pushing to multiple servers handle that and if there are reasons to prefer one approach over the other. I’m still just playing with this at home on one server.

                                                                                1. 1

                                                                                  Thanks for reminding me! I’ve joined the leaderboard & am working in Clojure

                                                                                  1. 1

                                                                                    Very useful, thanks. I may revisit my workflow now based on this nice write up. A few years ago I wrote wsup to solve the same problem. It works well for me, but needs updating..

                                                                                    1. 1

                                                                                      Other people have noted on the disparity of data structures across the comparisons.

                                                                                      I’d like to point out a deeper flaw. Rust versus C almost always use GCC as the benchmark. Yes, GCC is for many people the ‘canonical’ C compiler, but, because Rust uses LLVM, what you’re basically testing is GCC’s optimizations versus LLVM’s optimizations. To even the playing field and reduce disparity it almost always would be more appropriate to use Clang, and therefore you confine the Rust/C performance differences to actual features and benefits/flaws of the language, rather than features of two different code generators.

                                                                                      1. 2

                                                                                        he updated the article with a Clang comparison.

                                                                                      1. 3

                                                                                        https://www.zachary.com/ – posting infrequently about technology and its impact on me/society.

                                                                                        1. 2

                                                                                          thanks – I’ve been enjoying this series.

                                                                                          1. 1

                                                                                            Thanks, good to hear that, now I will ‘move’ to more hands-on articles when real configuration would be made instead of theoretical thoughts.