1. 3

    I’ve used yabai (né ChunkWM) and skhd on MacOS as a mouseless BSP-based window manager for several years now. While not exactly easy to setup/configure and not quite as powerful as i3 due to the MacOS window manager being a bit tougher to hook into, I’ve found it to be quite productive to use.

    As a downside, what /u/rustybolt said is 100% true:

    One of the drawbacks of using i3 is that nobody else can use your computer. Also, your head is full with key combinations. This usually works well, but if I didn’t touch my computer for a month, I’d have to stare at my config file for a while before being able to do some things.

    These go doubly for yabai/skhd, since no one is expecting a keyboard based window manager on what looks to be a vanilla MacOS install.

    yabai: https://github.com/koekeishiya/yabai

    skhd: https://github.com/koekeishiya/skhd

    1. 4

      Years ago I had some very intense lower back pain, and was convinced that it was the chair that I sat in for most of the day that was the problem.

      After browsing forums, blog posts, and perusing review sites to determine the best possible chair that I could purchase, someone mentioned in passing that my back might just be weak. Considering that my daily exercise regimen at the time was basically walking to and from the bus stop, it dawned on me that they could very well have a point. Moreover, a month-to-month gym membership for a few months was far less than what I was about to spend on an Aeron, so I figured it was worth a shot.

      Turns out, my back was weak. After a few weeks of strength training with a focus on back exercises, the sharp pain I felt while sitting for too long subsided, and then a few months later it disappeared completely. I’m now 8 years-ish into regular strength training, and I can (but don’t regularly) sit on a barstool for 8+ hours without any pain at all if I wanted to.

      The article posted has a small section on “Strength Building”, but it should, IMO, be more prominent. Try as hard as you might, you can’t buy yourself a stronger/better back and wrists.

      1. 0

        Why can’t we have a simple markdown renderer in a terminal with just regular bold, italic, etc? Someone, do it dammit! Do it in Rust! :)

        1. 3

          You can. Glow lets you define your own styles: https://github.com/charmbracelet/glamour/tree/master/styles

          The notty and simple styles probably are a bit too raw for your taste, but it’d be easy to strip the colors from the default dark & light styles.

          1. 2

            For a markdown renderer for the terminal in Rust there is termimad. Not sure if it’s simple enough for you though!

            1. 1

              Cool, thanks! This lead me to https://github.com/Canop/clima which uses termimad.

            2. 2

              bat does some minimal syntax highlighting from Markdown, and it tends to be good enough for my own uses:

              https://github.com/sharkdp/bat

              1. 1
              1. 1

                I don’t exactly get what 3.0 adds, since Channels and Daphne existed for a while, and were part of the Django project.

                I wish they made the ORM fully async, but that would be too breaking of a change.

                1. 5

                  If you meant in the sense that you were expecting more features from a major version bump then the version bump comes from their release cadence & deprecation policy (new since v2) which sees the major version bumped for the first version after every LTS release (which 2.2 was).

                  But if that wasn’t what you meant, then this talk by Andrew Godwin (PyconAU, Aug ‘19) gives a much deeper description of what’s going on under the hood to pave way for more exciting async features. v3 is laying the foundations.

                  1. 3

                    Personally, the two things I’m excited about in this release are:

                    • Exclusion constraints. So many things get easier to model and validate with them.
                    • The support for choice enums. This seems like a small thing, but it’s really a huge quality-of-life improvement.

                    Plus the end of the Python 2 compatibility shims, because that’s a reminder of how close I am to finally getting to write modern Python in the Django apps I distribute.

                    1. 1

                      Making the ORM fully async is also next to impossible without a herculean amount of work because all of the database libraries would have to be modified to support async as well.

                      There’s a really good talk (by the creator of Daphne) that was given at DjangoCon this year (https://www.youtube.com/watch?v=d9BAUBEyFgM) about the challenges of retrofitting async-await into django and plans to get there.

                      1. 5

                        Zzzeek (the creator of SQLAlchemy) wrote a very detailed blog post a few years ago about how everyone thinks they want async for their ORM, but it’s really not that great of an idea:

                        https://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/

                        1. 3

                          Making the ORM fully async is also next to impossible without a herculean amount of work because all of the database libraries would have to be modified to support async as well.

                          Also, I’m not too sure if a fully async ORM would be worth the effort. Sure, it might be an improvement, but if your database queries are taking so much time that they need to be async’d, maybe it’s time to optimize some queries.

                      1. 3

                        Moving! Time to get out of the rural life and back to city life. Was good while it lasted, but the boredom and isolation is real.

                        1. 3

                          Nearly all of my technical books are on paper. I don’t know why, but if I get a technical book on PDF I don’t actually end up reading it.

                          1. 13

                            Analog life tip: ask a librarian, or go to an actual book store (not a big box chain book store, if you can) and ask someone that works there.

                            1. 2

                              I don’t do this enough, but I do have a physical book store within walking distance of my house. Their little staff recommendations cards have been the source of several of my favorite reads over the last couple years. They don’t rotate enough to be usefull e.g. weekly but can certainly supplement other methods of recommendation gathering.

                            1. 2

                              Love this. So much about learning to program, for many people, is based around wanting to emulate something that already exists just for fun.

                              My first programming endeavour was on my graphing calculator in high school. I ended up creating a map editor that read values out of a stored matrix, and drew a map on the screen based on those values (e.g. “1” meant fence segment, “2” meant bush, “3” meant rock, etc.)

                              1. 6

                                For over 10 years I’ve been a very ardent (some would say zealous) supporter of (n(eo))vim, carefully tweaking and updating my configuration to be as barebones or as feature-full as I needed and desired, and spreading the gospel of Vim to all those that would listen.

                                About 6 months ago I tried out the vimagit plugin, which I found immediately useful. I then realized that this plugin was based off of the emacs magit package, which intrigued me further, and that sent me down a rabbit hole of trying out emacs with evil-mode (gasp! horror!).

                                I’ve been a (spac)emacs+evil user since that day. It combines all of the muscle memory that I know and love (complex word motions, edit sequences, etc.) from vim, and gives me a TUI-based editor that has all all of the project/IDE based functionality that I had always spent far too much time configuring and fighting against in vim. I just don’t have the energy for that anymore.

                                If you’re like me and love vim, and are looking to “revamp” your setup like the post describes, give Spacemacs a try. There are others, too (e.g. doom-emacs), and there are of course the DIY build-it-yourself setups that you can tinker with endlessly, but I was completely astounded by how intuitive and how short of a learning curve spacemacs with evil mode was.

                                1. 2

                                  Yes, I saw magit from my colleague and that’s how I discovered vimagit. I’ve heard good things about evil mode but I’m not ready to try yet, though you’re sound convincing.

                                  1. 1

                                    The emacs magit package was the primary reason I tried the switch. After watching a few instructional videos & reading some documentation, I had to try it out. It’s every bit as good as I had hoped for.

                                    Using emacs+evil with some project-level plugins like helm for autocompletion and projectile for navigation has been fantastic. It took me a few days to get used to some of the different key combinations to navigate around, but that was quite minimal in the grand scheme of things.

                                  2. 2

                                    One of these days I’m gonna bite the bullet and try out emacs. I have so much invested into my vim environment that it scares me to leave….

                                  1. 9

                                    We’ve used Flask for the past 6-7 years, and written dozens and dozens of applications with it, everything from small silly sites to full blown global e-commerce implementations that handle millions of dollars of sales.

                                    The flexibility it offers, while sometimes a disadvantage, ends up being very useful to us when we have special/odd requirements to fulfill.

                                    1. 2

                                      It seems pretty hard and time consuming to write e-commerce implementation in Flask. Don’t get me wrong, I like Flask, but it seems unsuited for such tasks due to the minimalist nature it embodies. I guess you guys have many in-house modules which you can reuse, which speeds development up quite a bit. How do you people manage?

                                      1. 1

                                        This was a very, very specialized task that involved gluing together a dozen different services from different departments within the same multinational company; one department built the product catalog, while the other built the product descriptions, while another was responsible for certain variants of each product, not to mention getting inventory from the fulfillment provider warehouses, or the department responsible for pricing, and many of the above was also on a per-country basis.

                                        It was going to be time-consuming no matter how you sliced it, really.

                                    1. 20
                                      1. 4

                                        how often do you receive email that is HTML-only and what do you do when that happens?

                                        1. 8

                                          I pass it to w3m using a mailcap entry. It makes most HTML mails readable. For the ones that still don’t display correctly, I ignore them and ocassionally send a response back to the sender asking them to stop sending unreadable mails.

                                          1. 7

                                            I also use mutt exclusively.

                                            Typically, HTML-only emails aren’t actually emails I want to receive. If, for some reason, I do need to view the email in rendered HTML, you can have the HTML attachment rendered in your browser. But most of the time it’s good enough to just pass it through to w3m and render the content in mutt.

                                            1. 1

                                              Are you able to sync address books from IMAP servers?

                                              1. 3

                                                I use lbdbq from lbdb with Mutt’s query_command and then configure whichever backed I need, i.e. abook, finger, LDAP, etc.

                                                1. 1

                                                  Mutt can use an external command/program to query for contacts. As long as you can get them out of whatever external system, mutt can use them.

                                                  For example, here’s how you can set it up so that mutt reads from your contact book on OS X: http://stevelosh.com/blog/2012/10/the-homely-mutt/#contacts (I don’t use this particular setup, but it’s well explained).

                                                  1. 2

                                                    When I use any other email client such as Thunderbird with my institution, once I configure the IMAP and server, the client is able to automatically fetch the relevant addresses (from some LDAP server I guess) for my institution. Thus, it is able to autocomplete the addresses even if I had never emailed a person before so long as they are an employee of that institution. However, I am unable to figure out where exactly Thunderbird (or apple mail) is getting this information from. I do not see any LDAP configuration in its settings.

                                                    So my question then is, how do I figure out which LDAP is associated with a particular IMAP, and is there any way to retrieve this information from other email clients?

                                                    1. 1

                                                      That is something I’m unaware of. I’ve always configured my contact syncing (from whatever source) separately from my IMAP configuration.

                                              2. 4

                                                HTML-only is usually SPAM, but I have a server-side html2markdown filter to add a text part in these cases, which works out maybe half the time. In (very rare) cases when I need to read an HTML-only email where the filter didn’t produce something useful, I hit the button in mutt to open in firefox

                                                1. 2

                                                  isn’t opening it in Firefox is worse than opening in a HTML-mail reader (like Thunderbird)? Firefox will run scripts, load remote images etc. Thunderbird disallows scripts and only loads remote resources through opt-in.

                                                  1. 2

                                                    What’s your threat model here? Do you think this hacker-ish setup is common enough to become a target? I think if a person is savvy enough to setup their email client this way, then they’re also savvy enough to quickly spot 99.9%+ of fraudulent emails.

                                                    1. 2

                                                      Mostly concerned about read tracking really. So this isn’t for targeted attacks but re-enabling the common threats

                                                    2. 1

                                                      On spam and newsletters? Yes. But those go in the trash long before getting opened :)

                                                  2. 2

                                                    I use mutt exclusively, but I do care about being able to read HTML.

                                                    When I get an email that doesn’t render in mutt, I hit H and it renders the email in Google Chrome.

                                                    I synchronise my email server (Fastmail) with mbsync, so I always have my stuff even if I’m offline. I use notmuch for searching.

                                                    1. 1

                                                      Non-sarcastic counter-question: Are people who read HTML email not worried about the privacy implications?

                                                      1. 5

                                                        I was under the impression that Thunderbird’s “don’t display images” feature is good enough to avoid this - please enlighten me if it isn’t.

                                                        I get by with seeing only the HTML body sans external media 90%. For some rare providers I do allow to load stuff, but usually I can “click to open website” and yes of course, they can then track that I read that mail - but I signed up for that newsletter and I am actively looking, so I guess that’s fair then.

                                                        1. 3

                                                          I, for one, am.

                                                          Honest question: do mutt or other non-HTML email systems handle typographical things you’d want from HTML? For me, the minimum would be underlining, italics, mono-spaced and proportional fonts. I’ve not yet discovered what to search in the manual.

                                                          1. 3

                                                            mutt itself doesn’t handle he html stuff at all: it just pipes the html to some other program which pipes back text to display. So you can do that if you want by piping it through a converter program and using a terminal that supports it, though personally I like not having any of those things. I like to be able to just read it.

                                                            1. 1

                                                              Honest question: do mutt or other non-HTML email systems handle typographical things you’d want from HTML?

                                                              I generally don’t want those in my emails either. I prefer plain text.

                                                              1. 3

                                                                You may prefer that, but my desire for more is well-founded.

                                                                The vast majority of systems for conveying textual information other than the limited world of terminals has supported the things I’m asking for, because they are useful. My personal most frequent use is monospace for referencing classes or code examples.

                                                              2. 1

                                                                mutt is a command line program, so whatever your command line can display is what you get in mutt.

                                                              3. 3

                                                                I use Fastmail’s web interface and the built-in Mail app on macOS and on iOS, and all of these have options to prevent images from being loaded unless and until you click a button to show them. My point being, defense against tracking pixels is a widespread feature at this point.

                                                                1. 2

                                                                  Any modern email client doesn’t load remote resources (images) by default, there’s a “show images” button.

                                                                  1. 2

                                                                    I have disabled auto-loading external images in gmail

                                                                2. 3

                                                                  How do you manage the address books? That is, are you able to hook into Gmail and other IMAP address books? (LDAP). This is the largest pain point for me

                                                                  1. 2

                                                                    I have a script that adds every email address I send email to to my mutt aliases file for easy tab completion

                                                                    1. 2

                                                                      I’m using vim-notmuch-address where CTRL+X CTRL+U completes email addresses (also works by name).

                                                                  1. 21

                                                                    It takes a significant amount of effort to write a technical blog post or create an interesting project.

                                                                    It takes almost no effort for someone to criticize it, as is shown every day on that orange site. The anxiety over making a slightly inaccurate statement or not creating the perfect example code to illustrate a problem has prevented me from doing a lot of writing over the years, even though I know that it shouldn’t bother me.

                                                                    1. 7

                                                                      My usual desktop

                                                                      I’m on OS X, and use a tiling window manager called ChunkWM with a hotkey daemon.

                                                                      There’s NeoVim with a variety of syntax/editing plugins on top right, a currently active PDB session on bottom right, various IRC channels and servers via Weechat on bottom left, and Mutt top left.

                                                                      With the combination of hotkey daemon, window manager, and the variety of CLI-based tools I use, I essentially never use my trackpad/mouse. Not shown is Firefox with a vim-like set of keybindings so that I can navigate with the keyboard.

                                                                      I’m also a huge motorsports fan, so the wallpaper usually rotates between various Formula 1 or World Endurance Championship scenes.

                                                                      1. 4

                                                                        How do you find ChunkWM? I’ve batted around the idea of installing it on my Mac at home, because I am a fan of tiling, keyboard-driven wms when forced to spend time in X; but I worry that it’d end up being a case of fighting the platform, a neither fish-nor-foul hybrid that manages to combine the worst of both worlds.

                                                                        1. 4

                                                                          It’s actually not that bad – there are a few configuration-level things that you need to setup to get things working smoothly, but once it’s going I really don’t have to touch it. I’m actually a bit lost when I need to use a computer that is not my own due to all the built-up muscle memory from the skhd hotkeys.

                                                                          But, it does have some flaws.

                                                                          1. When switching between single monitor & multiple monitors, sometimes windows don’t reposition themselves correctly and I have to hide all windows and then bring them to the foreground to get the chunkwm daemon to recognize them and resize them. It’s not a big deal, but it can be jarring the first time it happens to you. Also, this seems to have almost disappeared in the most recent versions of ChunkWM.
                                                                          2. When resizing windows, you can sometimes see redraw artifacts (edit: on further thought, this might be an issue with iTerm2 - I don’t ever see redraw artifacts on non-console windows). You can even see that in my screenshot that I took (it looks like an extra letter in the self parameter in the top right window, first line). The artifacts disappear when the window in question has to redraw itself again for some reason (e.g. you typed some text), but is supremely annoying.
                                                                          3. The default keybindings in skhd might be a tad annoying for non-English keyboards. I know when I need to type French accented characters, I have to go a circuitous route due to the use of the option key as the main skhd modifier.
                                                                          4. Some menubar applications will need to be added to the chunkwmrc config file as a “do-not-touch”, since chunkwm tries to tile floating menubar windows that appear, and it really just goes a bit nuts. This seems to have been resolved in the most recent versions of chunkwm, but I’m still a bit wary about it.

                                                                          Overall, though, for software that is at 0.4.x level of completeness, I’m very happy with it, and deal with the warts because the productivity it provides me is worth so much.

                                                                          The author of the software has gone through a few iterations of building these hotkey daemons & window managers for OS X, and seems to have taken a lot of knowledge and experience from past implementations.

                                                                        2. 2

                                                                          Another tiling window manager: https://www.spectacleapp.com/.

                                                                          1. 1

                                                                            +1 for Spectacle

                                                                        1. 7

                                                                          Trying to make meaningful contributions to some open source projects that I know and use, under the guise of Hacktoberfest, by implementing features or fixing tricky bugs.

                                                                          Sadly (or perhaps just disappointingly?), it seems like most people contributing to projects for Hacktoberfest are simply making pull requests for minor or almost irrelevant changes to things like README files.

                                                                          1. 3

                                                                            ’tis what happens when you gamify something.

                                                                            I’d say, if someone does this seriously, from a cold start, they’d need to pick a small bug for the whole month and get pointers from experienced coders on the project. At that point it would not benefit the project so much (because of the time it took away from the experienced coders).

                                                                            A useful way would be for experienced coders to pick an open source project they regularly use and have some familiarity with and use the month as an excuse to do bug-fixes or documentation improvements.

                                                                            But you know open source, community driven development: ’tis a miracle anything gets done at all.

                                                                            1. 3

                                                                              A useful way would be for experienced coders to pick an open source project they regularly use and have some familiarity with and use the month as an excuse to do bug-fixes or documentation improvements.

                                                                              This is essentially what I have done, and it’s been nice to make some OSS contributions again. I used to be quite involved in a few OSS communities, but life happened and I had to scale back my involvement for the past few years.

                                                                              I mostly feel bad for the maintainers that have to deal with all the somewhat irrelevant/bothersome pull requests that are fixing spacing or adding punctuation. Don’t get me wrong, I’m not against those fixes in general, but many are PRs for the sake of being a PR at this point.

                                                                              I know what it’s like to maintain an open source project, and you’ve only got a fixed amount of mental capacity to handle things, and clogging that up with a dozen or so trivial pull requests is a great way to burn out a maintainer.

                                                                              Oh well. Hopefully there are more people attempting to be truly helpful than not!

                                                                          1. 6

                                                                            That number is the total number of “upvotes” you have received on all comments and stories you posted on the site. Its the same number as your “karma” on your profile.

                                                                            1. 1

                                                                              Aha! Thank you. I had no idea those were counted.

                                                                              1. 4

                                                                                To clarify, it’s not the “total number of upvotes”, but rather (upvotes - downvotes), which gives you your net karma.

                                                                                1. 1

                                                                                  It’s in your profile, too, along with an average.

                                                                              1. 3

                                                                                Having used RCS/CVS/SVN/Git in professional environments, it’s astounding to see just how far version control has come.

                                                                                Sure, git/mercurial/etc. aren’t perfect, but you no longer have to wrangle RCS/CVS for projects with thousands of files (often where almost every file under control is at a different version number!), or wait 15 minutes (!) for a SVN merge to complete.

                                                                                1. 1

                                                                                  Haha you are history INCARNATED! I was posting this not only because I like the quick summary and the poster but also because I’ve never, ever touched those legacy systems!

                                                                                  1. 2

                                                                                    They were simpler times, but perhaps that’s just the past being analyzed through rose-tinted glasses.

                                                                                    I do distinctly remember the incredible frustration with having to deal with a CVS repository shared by hundreds of people, distributed around the world, and wishing that there was a better way to do things.

                                                                                    1. 1

                                                                                      If you want to feel how modern VC feels now, you should try Plastic SCM.

                                                                                1. 4

                                                                                  The article makes several good points, but it appears as though the author has a particular bone to pick with protocol buffers (mostly the map type, it seems) and comes off as more rant-y than constructive.

                                                                                  While only anecdotal, I’ve been working with protobufs for communicating with an embedded device with very restricted memory space, and after having evaluated the usual players (Avro, Capnproto, Thrift), protobufs was the only serialization protocol that was feasible to use. I would have preferred to use capnproto, but the lack of C-based support was a deal breaker.

                                                                                  In our particular use-case, protobufs made all the right trade-offs, even though I do sometimes curse at some imposed constraints.

                                                                                  1. 1

                                                                                    Did you consider ASN1/DER?

                                                                                    1. 2

                                                                                      Briefly, but I have 1) had bad experiences with some AS1 encoders/decoders in the past (some of them are terrible, and make seemingly unnecessary allocations), and 2) we are already pushing the boundaries of what the embedded chipset is capable of in terms of throughput, and serialization/deserialization speed and resulting payload size is legitimately a concern given how much data we are pushing per unit of time.

                                                                                      Also, the documentation for ASN.1 is… lacking, at times. If you’ve ever tried to figure out how to implement tags to support some kind of forwards/backwards compatible type definitions, you know what I mean.

                                                                                  1. 7

                                                                                    This is a fantastic post. I’ve been meaning to try out some non-trivial PostGIS functionality, and this is amazing.

                                                                                    It’s also a little disheartening for someone like myself to start a project such as this, mostly due to the fact that a huge amount of the setup involved is finding the right shapefiles for what you’re hoping to accomplish.

                                                                                    1. 6

                                                                                      I did a project last year where I finally had a good reason to knuckle down to learning some PostGIS, and I found out exactly those two things:

                                                                                      (1) PostGIS is amazing, especially with the QGIS integration. It allows you to perform what seems like magic in terms of processing times on layer calculations compared to the ArcGIS or QGIS+python-script world, spitting back out perfectly-transformed QGIS layers in double-quick time. It’s also surprisingly approachable; from a standing start, a lot of it does seem like magic, but once you get your head round the fact that it’s “just” a bunch of clever hashing and smart indexes, and all just in SQL, meaning you can do some really interesting stuff by “just” joining on those fields and using those provided functions, the magic fades away and you can get what previously seemed like really complex stuff done pretty quickly.

                                                                                      (2) Oh man, yeah, the dearth and spottiness of public availability of data for this kind of regulatory stuff is really, really painful. The sheer fact that most US stuff is broken down into totally irregularly-sized and -scaled legislatures is bad enough, let alone the fact that each one makes its own call about what data to publish and how. Don’t even get me started on LA cities and counties. Let alone the Valley.

                                                                                      But seriously, the fact that there are so many GIS-vs-SQL wizards actively involved in the ongoing development of an open-source tool like PostGIS is a pleasure to behold. That sort of thing really is the pinnacle of what a technologically advanced civilisation is about. (Excuse me, I think I have a speck of sentiment in my eye.)

                                                                                      1. 4

                                                                                        I fooled around with some shapefiles a few years ago for a personal project, and it legitimately took 10x more time to source the shapefiles (or other formats that I then had to figure out how to convert to shapefiles) than the very simple thing I was trying to accomplish in the first place.

                                                                                    1. 1

                                                                                      Oh eval, such a blessing and a curse.

                                                                                      1. 1

                                                                                        Thanks @jperras for your very interesting example.

                                                                                        I tweeted your “small caveat” citing you: https://twitter.com/pauloxnet/status/1049973313467011072

                                                                                        1. 2

                                                                                          My pleasure! Happy to spread some arcane knowledge gained through experience when I can. And thanks for the shout out!