Threads for sri

  1. 15

    I’m really glad this book is being written and hopefully it helps Nix getting more traction and better documentation! I associate the word production with professional deployments and I think the cover with the anime character and furry-like attributes is sending the wrong signal.

    1. 3

      I think it’s supposed to be reminiscient of textbooks such as “The Manga Guide to Physics”, though the content of that was a manga that taught you physics.

      1. 3

        Perhaps what we currently deem professional is about to undergo a world of change and stark deviattions such as this is a harbinger of such change.

        1. 3

          I would hope not. Bland and boring is least alienating, both to different demographics and different time periods. Edit: Changed my mind - burn it all down

      1. 4

        How do cli email clients like this handle displaying html email?

        1. 4

          himalaya read 150 -t html | w3m -T text/html or whatever your preferred browser may be (elinks, etc.). Ideally whoever is emailing you sends a plaintext copy as well.

          1. 2

            How would that deal with tracking pixels and such ? :/

          2. 2

            I use /usr/bin/lynx -force-html -dump %s when there’s no plain text alternative when reading email with mutt.

            1. 1

              Haven’t used it, but I guess you could do the same as with other terminal mail clients: stick the raw mail into a tempfile and open it with thunderbird -file (important part: the name of the tempfile must end with .eml).

            1. 7

              Good content but they should’ve use a different name for their intallation script though; the official sounding “nix installer” is misleading.

              1. 5

                Definitely more hardware design. I want to get to the point where I am able to build my own CNC machines from components to the software. Be it for 3D printing, milling, pick and place or automated gardening, I want to build them all! :-D

                I would also very much like to learn to sell my services at higher prices. So far I get the feeling that nobody wants anything and the only way to get paid well is to help move colored boxes on screens for some $MEGACORP.

                1. 3

                  Your hardware design goals are awesome. I’ll be rooting for you!

                1. 2

                  We have stuff at work that got rewritten from Parse over to Google Firebase because the former went out of business and was effectively unsupported for a while.

                  It’s one of the few cases where I think a complete product “rewrite” is reasonable. We were careful to keep the project structure largely the same between the old and new versions, so it was much more like a port than a rewrite.

                  In Parse’s favour, you could run it yourself in your own infrastructure. We did that fora while, but came to the conclusion that that was a bad trade-off for us in the long run.

                  1. 1

                    May I ask why it self-hosting Parse a bad trade-off. Was there a reason other than server maintenance?

                    1. 2

                      Yes, that. Self-hosting it gave us an excuse to do sysadmin work that didn’t generate value.

                  1. 1

                    The lack of auto-completion in the command line can be annoying but a quick <c-f> will move everything typed so far over to the command-line window(q:) where it is available.

                    1. 17

                      gq to format selected paragraphs.

                      1. 4

                        Tangentially, gq has a “dumber” counterpart gw, the difference between them being gw uses vim’s own formatting program but gq can be customized to use a user-specified one. So that will let us use different formatters for different filetypes etc. which is nice.

                        1. 2

                          You can also choose an external command to use by setting formatprg. I use par, which has terrible documentation but works great.

                          gw will do the same as gq, but always uses vim’s internal format engine, instead of whatever formatprg is set to.

                        1. 28

                          g+, g- (mic drop)

                          No, in all seriousness, the documentation sucks on this… So I’ll explain it how it was explained to me by a colleague:

                          Vim stores edit history and undo as a tree. For example, if you do A, B, C, D, undo, undo, E, F, undo, undo, undo, G, vim will store this history:

                                           D        F
                                           |        |      G
                                           C        E      |
                                           |        |      |
                                           +----+---+      |
                                                |          |
                                                B          |
                                                |          |
                                                +----+-----+
                                                     |
                                                     A
                          

                          g+ and g- will navigate between the “tips” of this tree, so between D, F and G. One goes back, the other forward. I never know which one is which between g+ and g- to go the way I want, so I always try both until I realize it’s going the right way :) .

                          1. 6

                            The undo tree is one of the most import features that is missing from all „vim emulations“ in other editors like vscode, pycharm/goland, younameit.

                            1. 8

                              Especially when you throw in a visualizer for it like mundo. Emacs has it as well.

                              1. 6

                                It should be noted that you can use proper vim inside of vscode if you use the neovim plugin. Basically all of nvim in normal/visual mode is available without much compromise. you can even call visual studio apis in normal mode if you map it in a vimrc.

                              2. 3

                                This is incredible. I’ve been frustrated when I’m at “G” realizing that no, I was right when I was at “D” and can’t go back.

                                It’s too bad that the emulator in VS Code can’t do this

                                1. 8

                                  if you use the neovim backend you can have the (almost) full power of neovim inside of vscode…

                                2. 3

                                  JetBrains IDEs have a local history feature for this. It’s fantastic, as it shows you a merge view between your current state and the selected history state. So you can still edit the current state and cherry-pick bits from the diff trivially.

                                  1. 3

                                    This is a great tip. I also cannot recommend the plugin vim-mundo enough which builds on the builtin undo-tree to provide a panel that let’s one jump through undo histories, search within them and my favorite, diff them as well. Like a very convenient zero-cost mini git.

                                  1. 34

                                    I particularly enjoy the Change In/Around commands: ci" replaces the inside of whatever double-quoted text block you are in, ca' replaces the single-quoted text block including the quote characters, and there are variants for various brackets, braces, parens, and paragraphs!

                                    1. 14

                                      another fun fact about ci” is that you don’t even need to be inside a double quoted string or whatever… it will go from where you are on the line to the next double quoted string and let you change that.

                                      so ci” on this at the | :

                                      lor|em “ipsum” foo bar

                                      would change it to this with you being in insert mode

                                      lorem “|” foo bar

                                      1. 12

                                        Best paired (…) with https://github.com/tpope/vim-surround which is the first plugin I miss on a fresh installation of vim.

                                        1. 8

                                          See :h text-objects for more details. You can also create your own using omap.

                                          1. 3

                                            I think this is a great introduction to writing your own text objects:

                                            https://web.archive.org/web/20201108142554/https://vimways.org/2018/transactions-pending (web archive link because the site currently has an out-of-date certificate)

                                            I mention is below, but kana’s vim-textobj-user is also very helpful.

                                          2. 2

                                            If you like text objects, I definitely recommend checking out these. (People may already know about them, but just in case…)

                                            1. 2

                                              Oh wow, I always used ct" or xcf", but those obviously only work from the beginning of the block. These are great!

                                              1. 1

                                                Yup, we should learn about text objects sooner rather than later and hen get the kana/textobj-user plugin which will also give you a whole set of new text objects to play with. There are also alternate approaches like targets.vim.

                                              1. 3

                                                DAE know how to update from Nix 2.3 (macOS/single-install). The nix upgrade-nix doesn’t seem to upgrade beyond 2.3.16. Do I just run the new 2.4 install script; or is it assumed I’ll have to uninstall 2.3 first and then run the 2.4 install script?

                                                1. 3

                                                  Does the upgrading page in the manual help? If not, I suspect 2.4 hasn’t hit the darwin channel yet (what channels are you using?).

                                                  1. 3

                                                    I’m using nixpkgs https://nixos.org/channels/nixpkgs-unstable. The page didn’t help, but like you said - the update is probably yet to hit or something like that. If that all it is, I can def wait, thanks!

                                                    1. 4

                                                      It’ll take a bit for the new version to work it’s way through nixpkgs. Uninstalling is still a pain, so I’d say it’s only worth the hassle if you are blocked for any of the new features.

                                                      1. 4

                                                        Like the original commenter, I also can’t update from Nix 2.3 to Nix 2.4, on any of my systems (linux and macOS). It really doesn’t paint a good picture about the project that days after the announcement many still can’t update.

                                                        1. 1

                                                          I guess it is up to you how you see the picture, but I don’t see the problem, here.

                                                          Nix is a package manager, and nixpkgs is a massive package repository built atop it. IIUC upgrade-nix uses the latest stable nix, as declared in nixpkgs. For nixpkgs to change the stable version of Nix, it needs to make sure the package manager and the massive package repository are compatible (regardless of which must change to make it so).

                                                          Making it easy for general users to gleefully upgrade existing installs to a new version before ferreting out incompatibilities would be a little reckless.

                                                          That process did indeed catch at least one regression, so work is ongoing to iron it out.

                                                          You can always force the issue with nixUnstable, as noted in caius’ comment.

                                                          1. 1

                                                            The nixpkgs PR I linked before (https://github.com/NixOS/nixpkgs/pull/144197) merged a little bit ago, so the upgrade should be available via nix upgrade-nix now.

                                                        2. 4

                                                          I found sticking nix.package = pkgs.nixUnstable in my darwin-configuration.nix jumped it up to nix 2.5pre version. Was going to sit here until the 2.4 release had worked its way through as stable.

                                                          1. 2

                                                            The update has been merged into nixpkgs in the past hour, so the upgrade should be available via nix upgrade-nix now.

                                                            1. 2

                                                              And done. Appreciate you taking the time to let us know, thanks!

                                                      1. 82

                                                        _why was influential to me, too. My favorite _why quote:

                                                        when you don’t create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.

                                                        1. 7

                                                          I keep meaning to add this to my quotes file. Thanks

                                                          1. 4

                                                            Do you have your file online somewhere? I loved that quote and if you got more like it, I’d love to check it out.

                                                            1. 3

                                                              At the moment I have them written onto blank playing cards but I’m going to digitise them (and figure out the best way to present them to myself at my computer)

                                                          2. 2

                                                            It’s a beautiful quote.

                                                            But, does it not also follow that if you create, you will then be “narrowed” and excluded by the tastes of other people, in addition to having an ability to create?

                                                            1. 9

                                                              I think that’s a very clear definition of typecasting. Every creator, artist, and actor fears it and has to push themselves outside of their comfort zone for double down on what they’re good at and own it. This is a false dichotomy. It’s generally advisable not to stay in your lane when it comes to personal growth.

                                                          1. 2

                                                            Just published Command line text processing with GNU Coreutils, so I’m going to relax this weekend (might stay away from book writing for the rest of the month).

                                                            I’ve enjoyed reading slice-of-life fantasy novels like The Wizard’s Butler recently, so I’d be looking for more such books to read.

                                                            1. 2

                                                              Looks like a pretty good weekend read, good job; I could use a coreutils refresher for sure.

                                                              1. 2

                                                                Thanks. And yeah, this works as a reference for me as well :)

                                                            1. 4

                                                              Getting used to my new Moonlander keyboard

                                                              1. 3

                                                                How do you like it? I really like mine.

                                                                1. 2

                                                                  So far, Its OK. I’m having problem with keys on the far right side of the keyboard. I’m using a QWERT-variant and are having problems reaching the P-key. My hands and shoulders hurt like hell and my speed has gone from 70wpm to about 20wpm.

                                                                  I got the keyboard to fight pain in my right hand. I am going to take it slow with this keyboard, and hopefully it will help in the long run.

                                                                  1. 1

                                                                    Ouch, that is not a good place to be. I have struggled with RSI myself, and some time ago compiled a list of some things that helped me overcome the worst of it. It’s still with me, but I’m hoping the Moonlander will help! (This is the first non-training message I have typed with it.)

                                                                2. 2

                                                                  That looks really cool, the programmable backlights and the little thumb board part.

                                                                  1. 3

                                                                    To me, the dealbreaker is that it’s programmable by firmware. I use my keyboard for several client issues computers, on them I can no install software for doing that sort of thing.

                                                                    1. 2

                                                                      The thumb cluster is a major reason I chose it. The programmable backlights strike me as frivolous; if there was an option to drop them and save money I’d have taken it. But maybe I’ll learn to love it?

                                                                      1. 3

                                                                        I find the backlights useful while training, to keep track on what layer I am on. I expect I’ll turn all of that off once I’m used to it.

                                                                    2. 2

                                                                      Same! Mine arrived on Friday and I’ve broken it out of quarantine early. It took some reading of the manual before I found the space “bar”… I’ve not yet decided if I will move the key caps around to match the Dvorak layout I use. (I’m slightly worried it will make me start looking at the keys as I type again.)

                                                                      I’m also torn between changing the layout in the keyboard to send Dvorak, or just keeping the default and leave the OS to do the remapping.

                                                                    1. 1

                                                                      hawk - a pretty awesome awk replacement. Also I know this is tangential, but gotta give some credit to iTerm - a fantastic price of software that makes the command line a very smooth experience for me. I haven’t seen many paid applications with that kind of polish.

                                                                      1. 4

                                                                        I have always hated the little bits of web dev that I have had to do for work. So I am biting the bullet and building a website so that I can thoroughly understand the whole stack without dealing with corporate red tape. I also might potentially try to build a game on the website sometime. I think I am going to use Deno to learn JS/TS and so that I don’t have to have to use a whole cornucopia of technologies.

                                                                        1. 2

                                                                          I don’t have to have to use a whole cornucopia of technologies.

                                                                          So with you on that. I recently ramped up my Elm familiarity because I’ve gotten increasingly frustrated with coming back to a project a while later and finding multiple parts becoming outdated. I’ve really come to like the Elm and their architecture. It’s slightly verbose coming from other functional perspectives, but that’s almost nothing compared to how many other grievances it alleviates.

                                                                        1. 9

                                                                          Do you have any examples of libraries in other languages or language features, which really should have implemented a well-known concept (Monoid, Monad, Alternative, whatever), but they fell short because they (probably) didn’t know the concept?

                                                                          This sort of presumptive arrogance is a massive turnoff for me, and I think that it really hampers my ability to take Haskell users or their community seriously.

                                                                          This whole “well-known” idea is glib coming from the community whose running joke is just a monoid in the category of endofunctors–i.e., famously academic and up its own ass.

                                                                          A better way (hell, we could start it in this subthread) they could’ve brought this up would’ve been “What Haskell idioms (Maybe, monads, etc.) do other ecosystems implement almost like we would but then diverged? What idioms do we have that’d still be doable in those ecosystems?”

                                                                          Instead, it comes off as some ignorant elitist prick dismissing the slovenly masses daring to attempt to fumble their way through shipping code in spite of their own ignorance of the magic of Haskell, somehow managing to cobble together pale imitations of algorithms and techniques in their inferior programming tongues.

                                                                          Pandoc and shellcheck are maybe the only Haskell programs I use on a regular basis, but I could get along without them. I couldn’t get along without the flotsam and jetsam of “inferior” languages like C and JS, and I’m kinda amazed that in 2020 people still represent Haskell like this.

                                                                          EDIT: Just to be clear, I know some Haskell folks (@pushcx, @shapr) that are kind and just excited and happy to share their experience without shitting on other languages I use…but they seem to be in the minority.

                                                                          It’s the difference between “Haskell is the one true language why are you settling for anything else?” versus “I really like Haskell and think it’d be a good fit for your problem, want to talk more about it? If not that’s cool my dude, one day I’ll talk you into it. :)”

                                                                          1. 10

                                                                            I totally understand. Do give that community some benefit of doubt though, as this is a link to a thread within the haskell subreddit where the posters feel free to write without having to preface every post/comment with qualifiers as it might get a little tedious if they had to do that on every thread and comment. If we’re not part of that subreddit, in a way, we are peeking in as an outsider and before judging them harshly, we’ll have to read it with their perspective in mind. Hope I’m making sense. I was almost not gonna post here because of the potential for misunderstanding their tone but it was just a really interesting topic and I was wondering if I could get more viewpoints over here. Although now I’m not sure if it was worth it.

                                                                            1. 3

                                                                              Thank you for the caution towards charity and reasonableness!

                                                                            2. 6

                                                                              I like being called out for kindness and excitement.

                                                                            1. 8

                                                                              Honestly I use macos Notes.app for this. It’s really good for taking quick notes and has enough organization for what I need.

                                                                              1. 1

                                                                                Keep coming back to this. I think the omnipresence and sync does it for me. I’m looking forward to using a lot more of the handwriting recognition too.

                                                                              1. 6

                                                                                Learning C and a game of paintball with friends cause one of them is becoming a dad, followed up by an Indian restaurant which will probably end with me spending my Sunday on the toilet. :-)

                                                                                1. 4

                                                                                  There’s a resurgence of interest in C apparently, looking through this thread. Kinda inspiring me to rehash it myself. After I’m done with Haskell, maybe I should go back to the kilo project I abandoned. How are you doing your learning. Do you have a structure in mind or like a book or something?

                                                                                  PS - As for the Indian restaurant, apart from asking it to be less spicy, I suggest getting a generous helping of “ghee” and finishing your meal with a “dahi” dish. The restaurant should know those words. That’s how my folks keeps the burn in check :)

                                                                                  1. 3

                                                                                    That’s how it feels to me too, my Mastodon feed is full of people picking up C (again). Personally I just want to broaden my understanding and having recently picked up Rust, better see what it attempts to improve on. I’m going by the book, doing the basic exercises and then hopefully a small toy project.

                                                                                    Thank you for the tips! I actually really do like spicy (Vindaloo is my favorite) and normally the afterburn isn’t that bad for me, but this particular restaurant somehow had that effect last time. It’s a restaurant in The Netherlands so my guess is that they’ve toned down all their dishes a lot compared to “the real deal”. Definitely going to try the dahi finisher!

                                                                                    1. 2

                                                                                      You’re welcome :) and btw been a lomg time since I read that book but I remember it being a really good one - so compact, simple and well written! It’s like the programming equivalent of The Elements of Style. Wish you well on your endeavor!!

                                                                                1. 25

                                                                                  Ya boy is getting married!

                                                                                  1. 4

                                                                                    Confusion to your enemies!

                                                                                    1. 2

                                                                                      Congratulations!

                                                                                      1. 2

                                                                                        Congratulations! My wife is my better half in more ways than I can count :)

                                                                                        1. 2

                                                                                          Congratulations!

                                                                                          1. 2

                                                                                            Congratulations!

                                                                                            1. 2

                                                                                              That’s awesome! Have a great time and congratulation on your wedding!!

                                                                                            1. 2

                                                                                              I’ve actually stopped using Python for most of my CLI programs because I’ve fallen in such love with the Rust ecosystem. However, this would make me reconsider that decision under certain circumstances. Way to go with building and releasing such awesomeness!

                                                                                              1. 2

                                                                                                I know it’s just a comment but I put a lot of work in this, so your words mean a lot thank you :) I don’t know much about Rust but either way CLIs really do need to be simple to be enjoyable to write for sure!!