1. 10

    I am considering switching to evil; I’ll never surrender Emacs, but I can see the appeal of modal editing.

    1. 7

      I’m a long-term Emacs user, but about five or so years ago I was starting to feel a bit of strain on my hands and forearms from all the typing I was doing. While Emacs usage surely wasn’t the only culprit, I went ahead and switched to evil-mode to give it a try, and I’ve never looked back–I personally feel like the configurability and programmability of Emacs is ideal, while the modal editing of Vim is ideal, so having them together in one package seems like the best of both worlds. It seems to have helped alleviate the strain as well.

      Anyways, this is all just to say, I highly recommend giving it a shot and seeing if you like it (EDIT: but keep in mind there is a learning curve…it was slightly less painful for me since I’ve been using Vim off-and-on for sysadmin-related tasks for years, YMMV).

      (Note that there is also god-mode which sounds interesting, but which I haven’t tried.)

      1. 2

        Another evil-mode convert here. Switched a couple months ago. The most surprising thing to me was how many libraries are out there to make evil so much more attractive: evil-args (each argument in a C-style function call is a text object), evil-surround (parens are a text object), evil-collection (hodgepodge), evil-goggles (animate region before deleting or yanking it), evil-indent-plus (all text at the same indent level are a text object), evil-escape (jk/kj). The idea of having a “text object,” which gently composes with all the verbs Vim/evil gives you, just opens up so many new opportunities for library authors.

      1. 3
        git clone $url ~/.dotfiles
        cd .dotfiles && git config core.worktree ~
        alias dgit='git --git-dir ~/.dotfiles/.git'
        cd ~ && dgit checkout .
        vim .something && dgit add .something && dgit status -uno
        

        I stole this from a Hacker News comment way way back, but it works great.

        1. 4

          We are using TypeScript and FuseBox at work. TypeScript good: lots of popular libraries have third-party type declarations, it’s fast, it’s constantly updated, it works great with React Native, & FuseBox is a total (and essentially drop-it-in) replacement for Babel for us. TypeScript bad: verbose error messages more confusing than helpful sometimes & function parameters and return values stuck at bivariance. Shocking that the jump from untyped to typed JS was so smooth. Heard similarly great things about Flow.

          Overall it’s a great time to write iOS apps where simple views are just purely functional, completely typed React Native components! Use redux reducers as your StateT over some RootStore state; use jest.mock() and redux-saga to discharge side effects and allow for unit tests. The only warning I’ll give is that you should keep view controllers in ObjC – nobody has taken the time to patiently transcribe all of Apple’s delegate methods into JS yet, and even simple apps will want to break out of the JS world.

          You know, I remember with great fondness writing JS as one big spindly blob with jQuery and maybe whatever half-baked implementation of classes you wrote. No tooling, no MDN, no linter or prettier or anything. The lawless days where a DOM node could be pushed around however you wanted. Tumbleweeds. Sand. Water every thousand miles. Fondness.

          1. 2

            If you’re on macOS and already have Dash.app installed, check out open dash://manpages:$1 (e.g. open dash://manpages:ls).

            1. 3

              And if you want a nice-ish PDF:

              man -t ls | open -fa Preview

              1. 3

                I put together a script for that. It’s a little overengineered to catch missing dependencies, but it’s kinda nice because it puts the PDF output in $TMPDIR as a cache for subsequent retrievals of the same manpage.

                https://github.com/colindean/hejmo/blob/master/scripts/man2pdf

            1. 2

              I got the chance to read some scifi this year! The Rocannon’s World-Planet of Exile-City of Illusions trilogy by Ursula Le Guin were page-turning reads.

              1. 3

                What is practical difference between it and large enough max-age? Is it designed only to avoid “multiple years long max-age” hack?

                1. 7

                  When you hit the refresh button in your browser, it’ll re-request every asset that was served with a still-valid max-age. Typically those re-requests will have If-None-Match or If-Modified-Since headers that allow the server to send a HTTP 304 response for them. So assets requested with a long max-age will take at least one RTT to check that they’re still valid, plus a negligible amount of bandwidth.

                  Browsers can refrain from re-requesting assets marked as immutable when you hit the refresh button. (I think they may still do so if you hit force-refresh). IIRC the convention on Windows browsers is that the refresh button is F5 and the force-refresh button is shift-F5.

                  Some people are used to pressing the refresh button on their browser to make the data that they’re looking at be updated (rather than, or additionally to, pressing any in-app refresh button). Avoiding re-requesting the stuff that is known to absolutely positively never change under any circumstances we promise for realsies makes the website’s UI load quicker after a person presses the refresh button.

                  1. 2

                    So we have refresh and no really refresh commands, plus cache and no really cache commands. Maybe we should just encode priorities. This is a priority four cacheable object, not to be refetched unless the user issues a level five or greater refresh.

                    1. 2

                      So we have refresh and no really refresh commands, plus cache and no really cache commands. Maybe we should just encode priorities. This is a priority four cacheable object, not to be refetched unless the user issues a level five or greater refresh.

                      And then most of the internet will end up becoming top priority because users should never update anything. And then there will be new priority RfC and we will have priorities and not really priorities.

                  2. 4

                    User-driven refreshes can override a long max-age, but not an immutable. (I think.)

                    1. 1

                      You could build offline accessible sites by setting some initial download as immutable.

                    1. 5

                      good to know that the impulse to shit on everything is still alive and well on the internet

                      1. 3

                        Yes. This. Wasn’t this site created as a high quality alternative to hacker news and reddit? The tone in this thread shows zero difference. We can do better than that.

                      1. 12

                        Run your own server! People are terribly frightened of email, but it is only slightly more complicated than running an HTTPS server with some DNS jambalaya. I use Mail in a Box on a VPS for my low-traffic personal email addresses and it works great. It is an actively maintained project that comes down to a shell script you can read and execute on a clean Ubuntu environment. You get spam filtering and DomainKeys and Let’s Encrypt and webmail and iCal out of the box. You might do it to save money, to learn a little bit about how email works, or both! I use a pretty reliable VPS (Vultr), and although I know VPSes tend to fail at the worst opportune moment I only ever experienced downtime when I ignored the email from Mailinabox (it sends you notifications about the system through email, which I think is clever) about keying Y on the Y/n prompt for the new Let’s Encrypt terms of services.

                        1. 4

                          People are terribly frightened of email, but it is only slightly more complicated than running an HTTPS server with some DNS jambalaya.

                          It gets much more complicated once you setup DKIM, DMARC, POP3 and IMAP, spam filtering, etc.

                          1. 3

                            and then you find your cheep arse vps ip has a dirty reputation and need to work out how to get yourself white listed (did it for hotmail, painful but effective)

                            setup DKIM, DMARC, POP3 and IMAP, spam filtering, etc.

                            mail in a box is magical. setup DKIM, DMARC, POP3 and IMAP, spam filtering in a few mins. highly recommend

                            i tried to write a playbook for this but gave up, its just to complicated. given a couple weekends can get it up manually but when shit breaks its painful.

                        1. 1

                          The Unicode is great, getting “Straße”.uc right and using a clever constant-time algorithm for addressing codepoint-combined graphemes

                          I got real curious about this sentence so I looked up the C function that does case-changing in MoarVM. Can’t quite figure out where the cleverness is yet, but if you do drop me a comment reply.

                          1. 35

                            Well, to take something positive out of it, I didn’t know that @coraline ’s team was responsible for first-time contributor badges and the new repo invite email process! Thanks!

                            1. 16

                              Yeah, it sounds like she got a number of good changes implemented while she was there! I’m sorry her experience was so terrible. It’d be great to still have her there, pushing for this sort of change.

                              Reading between the lines a bit, it sounds like GitHub leadership may have made the move to hire her without really getting buy in from the company about the need for a greater degree of empathy and consideration for marginalized groups. So she comes in having gotten a great song and dance about how they want to change, but the rank and file are hostile.

                              1. 16

                                I see it both ways:

                                https://lobste.rs/s/js3pbv/antisocial_coding_my_year_at_github#c_h8znxo

                                They were probably hostile to any changes due to whatever lack of empathy or consideration they had. Maybe some deliberate discrimination, too. Who knows but I assume some to a lot given SV’s demographics. ;) Then, they see a possibly-recognizable, political extremist that attacks or censors anyone disagreeing with her on a campaign to benefit everyone but them. She’s also loads the team up with people as unlike them as possible who all agree people like them are the problem. This combo is a powder keg for political infighting.

                                This story has enough villains who think they’re heroes to be a lot worse than it was. I’m glad it stayed as civil as it did with some benefits coming out of it. That said, your comment totally neglects the aggressive politics and censorship she pushes in your description of why there would be resistance. I remember one story submitted to Lobsters that thankfully didn’t get upvotes where the author talks about having “two, token, white men.”

                                https://fusion.kinja.com/what-github-did-to-kill-its-trolls-1793864044

                                I looked at that thinking, “Really? They say they’re about inclusiveness and equality but just said the word token followed by a race with no serious consequences?” Maybe it was a joke. I doubt it given the article similarly acted like Coraline’s opponents appeared out of thin air and only wanted to stop good deeds. So, again, her political aggression w/ censorship goals and apparently anti-white-male attitude should be considered when assessing response in an organization with lots of people who might not cooperate with such things.

                                1. 5

                                  Maybe it was a joke.

                                  Token white men is an obvious joke. Yes, it is not a joke when it refers to minorities but it is a joke when it refers to white men. Yes, in an imaginary world where all races are equal this wouldn’t be a joke. Perhaps the joke is about the fact that we do not live in that imaginary world. Perhaps getting worked up about the diction by an entirely different writer in a one-year old article is completely irrelevant to this thread and has no bearing on the author’s supposed hidden political agenda and anti-white-male attitude.

                                  I honestly do not understand why anybody would give Github the benefit of the doubt. How many awful things are we going to hear about Github, written under the bylines of people who are risking their careers and their reputations – authors who know that anonymous commenters on threads like these will drag their names through the mud a million times over, dredging up old posts and using shitty three-letter acronyms invented by angry white men –, before we start believing that they might contain a kernel of truth? A comment on Lobsters asking Coraline to be more like Martin Luther King, Jr. has 54 upvotes right now; at least 54 people have bought into the idea that if you are less morally upstanding that Martin Luther King, Jr. then you do not deserve to publish an article on your own blog detailing your own experiences. This is a two-billion dollar company that does not need your help defending it. To the people who are writing screeds against the author here, this single blog post is not some sort of silver-bullet shot fired at your culture: You have already won. You have the money, the executives, the jobs, the social networks, the access. You are winning. Congratulations. Jesus fucking Christ.

                                  1. 6

                                    “Yes, it is not a joke when it refers to minorities but it is a joke when it refers to white men.”

                                    That’s exactly the kind of structural, reverse racism I’ve had to deal with. Also a double standard. They’re in a position of power, they’re minimizing any white/male people as much as possible, they write up an article about what they’re doing, and mention token, white males as a joke. Discrimination ain’t funny. Calling them out on hypocrisy is certainly worth my time.

                                    The bigger part of that article wasn’t the joke so much as it’s a bunch of people with SJW politics misleading readers into thinking they’re taking hate just because they’re minorities or getting people to play nice. They leave out political domination, launching mobs against Github projects, etc. Supports their false narrative where they’re the victims of attackers rather than the attackers themselves meeting both political resistance and just self-defense by those they’re targeting or trying to control.

                                    1. 9

                                      I think there’s a very thin line that needs to be respected when discussing these topics. This same argument has frequently been used to diminish the arguments of minorities who rightfully speak out against prejudice. I don’t know enough about this particular instance to comment about it, but we should be careful about the vocabulary that we choose in these discussions, because some phrases have unfortunate implications.

                                      In particular, “SJW” has frequently been used as a catch-all phrase to disparage people who speak out against racism/sexism. I think if we’re going discuss this topic on this site, we should have a better understanding of the connotations our words carry.

                                      A lot of this same argument, with the same sort of vocabulary, was invoked by more extreme members of the GamerGate community, who did a massive amount of damage to minorities in the gaming industry. Seeing you use it here damages the credibility of your position for me.

                                      1. 1

                                        “This same argument has frequently been used to diminish the arguments of minorities who rightfully speak out against prejudice. “

                                        Which doesn’t really matter if it was coming from obvious racists or sexists ignoring data or selectively using it to push their agenda. They can be called out on those grounds. The SJW’s actually like that, though, since it lets them just associate such people with any use of the term and then ask people stop using it. You’re doing that as well but maybe for more honest reasons.

                                        “I think if we’re going discuss this topic on this site, we should have a better understanding of the connotations our words carry.”

                                        I’ve been very specific in at least two comments about what kinds of people SJW term is about. I’ve also linked to examples of their behavior involving forcing a minority in a minority view on people, using sophist tactics, censoring opponents, and going after their jobs or projects. These are not people just fighting racism or sexism that provably exists. I’m one of those people. I obviously wouldn’t dismiss just that with some BS label.

                                        “A lot of this same argument, with the same sort of vocabulary, was invoked by more extreme members of the GamerGate community,”

                                        It’s funny you mention that because it was my first realization these people existed in some big trend. I’ve studied and countered disinformation tactics for quite some time but not known about assaults on media, forums, and so on. The GamerGate reporting I read about in gamer-oriented media was extremely one-sided only showing what the feminists/activists said. I thought it was about minorities expressing some opinions, a relationship breakup w/ revenge porn, and the examples from gamers were all pure hate mail that apparently came out of nowhere. Some smart folks I know sent me a video that blew my mind:

                                        https://www.youtube.com/watch?v=GXZY6D2hFdo&app=desktop

                                        In this video, new information is introduced that I didn’t see in half a dozen articles I read. The author mentions at least two women involved were claiming gamers were unnecessarily violence-loving, sexist, and racist. Whether true or false, that was an attack which has predictable consequences for anyone who knows gamers. One had an academic paper saying how games should be done in a totally different way or developers + players were just evil. On top of it, the females developing games were doing some of the same behavior on the list of No No’s to make money. Interestingly, they also ignore that the supply side responds to market demand, the games that are like their list don’t sell, the games doing the complaints do, and that demand side includes a huge chunk of women. So, they were claiming bad things about all gamers, ignoring women gamers’ views on the matter, and hypocritically doing what they said shouldn’t happen for money. And then the hate rolled in.

                                        Quite justified although obviously not supporting the extremist stuff. The regular gripes, mockery and so on makes sense with that backdrop. The thing that shocked me was it wasn’t reported in the articles I read from publications for gamers. Somehow, the gamers’ side of things with very, legitimate counterpoints was censored. Why was that? Why were these people not mentioning their negative claims about gamers or how they did the same things for money? Why were they only mentioning how they tried to do some nice things about (social justice stuff here) with the gamers just doing horrible things because they’re evil males and stuff who were unprovoked? Then someone told me they were SJW’s with this being their default tactic of looking like a victim, making news afraid to report whole thing, and causing big shitstorms. More research found similar attacks on many social issues where one side made a decree then declared holy war on enemies always claiming harassment, asking foes be censored, and so on.

                                        If you thought GamerGate was evidence feminists were treated unfairly, then it damages your credibility for me because you may have never known what those select few did to gamers, you may not know why the information was censored at media level, and you would’ve been griping about their victims while supporting the original perpetrators. I can’t blame you as I did it early on not knowing anything about how these deceptive, manipulating “activists” operate. Thanks for reminding me about my wake up call on the subject, though. :)

                            1. 5

                              Something else to consider: if you use George Nachman’s excellent iTerm app on macOS, it comes with first-class integration with tmux (via its command-and-control interface tmux -CC). Meaning that tmux tabs are turned into iTerm tabs, tmux scrollback is turned into iTerm scrollback, etc. This also means you can use iTerm keyboard shortcuts instead of having to go through the special tmux prefix. One of the cool things about tmux is that they accepted patches from Nachman to get the interface implemented. There’s something to be said about having a modern codebase with an invigorated community hosted on a popular social network.

                              Anyway I was blown away by the design and execution of the idea when I first ran into it. Thought I’d mention it as some sort of killer feature.

                              1. 3

                                A technique I use when setting the PATH goes:

                                PATH="${HOME}/bin${PATH:+:${PATH#${HOME}/bin:}}"
                                

                                This command prepends ~/bin to PATH. If ~/bin is already at the front of the PATH is doesn’t append it again. If PATH is not defined it avoids appending the path separator, ‘:’, to ~/bin.

                                # If PATH is defined, prepend ":" to it (the +):
                                ${PATH:+:${PATH}}
                                
                                # If PATH begins with ~/bin:, remove it (the #):
                                ${PATH#${HOME}/bin:}
                                

                                This makes setting PATH generally idempotent, though it has a bug where ~/bin will be added to PATH twice if PATH is empty or unset. It’s also not idempotent if another directory is added to PATH between two invocations adding ~/bin to PATH. It works well enough in practice.

                                1. 9

                                  Obnoxious zsh user chiming in here: in zsh you can typeset -U path to annotate the variable as being a unique array and then use array operators, like path+=(~/bin) for append or path[1,0]=~/foo for prepend or path=(foo $path bar) if you like cleaner syntax.

                                  Another zsh note unrelated to parent comment: in zsh there’s ~/.zshenv if you are looking for the Right place to modify the path variable. Most of the zsh package managers / configuration frameworks should gently guide you toward that filepath.

                                  1. 3

                                    Second zsh user, here’s my over-engineered method of setting PATH, along with MANPATH and fpath too: https://library.evaryont.me/evaryont/dotfiles/blob/master/zshenv

                                    The file automatically finds itself (assuming that ~/.zshenv is a symlink to the git clone of my dotfiles repository) and has a large list of directories that I want in my path, sorts, expands and make makes each array full of unique values. Super quick, too!

                                    1. 2

                                      That’s not over-engineered. Mine has arrays of common prefices where installation trees can be found, common patterns which might exist therein, functions for manipulation and so forth. You might want to use the (N/) qualifier on entries: only match directories, and remove from the list if no match.

                                      1. 1

                                        Interesting. Can you share your config?

                                    2. 1

                                      This small script from my dotfiles appends paths to $PATH only if they are existing. I think this solution is quite readable but it does not prevent a path from being added twice.

                                    1. 1

                                      this is a great resource but a little outdated. megaparsec and trifecta and a few others are now the vanguard for monadic parsing in haskell. daan and paolo’s package, parsec, now exists as a retired elder statesman of the haskell universe

                                      still, however, much of the api is the same and the core idea – the beautiful notion that we can build large complicated parsers out of small simple ones by using algebraic operations from the world of applicative and monadic functors, no matter what programming language we use – remains the same

                                      1. 1

                                        Last I checked, attoparsec by Bryan O'Sullivan was another popular option.

                                        He wrote a good article a little over two years ago showing it can potentially have performance comparable to a hand-rolled C parser. From previous experience (course projects) it’s fairly straightforward to use, though as a disclaimer I’ve never actually used Parsec so I can’t compare them directly.

                                      1. 2

                                        I believe this is the paper that describes how to search for quines with miniKanren. It appears to be doing something fascinating: translating Scheme code into miniKanren code and back.

                                        1. 3

                                          Great blog post! Lots of neat Perl 6isms. RSA-wise, it might be faster to first pick your e (real-world implementations choose from a fixed list of so-called “public exponents” [read: 3 or 65537] that are known to make modular exponentiation faster) and then to repeatedly search for primes p, q of the desired size such that p mod e != 1 and q mod e != 1. You can also make your prime search slightly faster by generating only a list of odd numbers; I imagine there’s some sort of cool Perl 6 syntax for doing skips in list sequences.

                                          1. 2

                                            Always nice to see more free resources for category theory out there. For a taste of what you can do with category theory in practical programming, I recommend reading The Comonad.Reader, a blog maintained by Edward Kmett. His interests are omnivorous, ranging from using duality to model infinite streams to a three-part series on efficiently implementing the free monad with Kan extensions. I confess I have a difficult time understanding all of it, but whenever I put in the effort of reading, noting, and googling (googling a lot) it’s been nothing but rewarding. If nothing else it’s nice to have a vocabulary to identify ideas like free monads and natural transformations, both of which have popped up in the Haskell I’ve been writing for work.

                                            1. 4

                                              Not to mention ekmett is just a damn nice guy. When I was first getting into Haskell, he was pretty much my mentor on the #haskell IRC channel. He’d tell me with no small degree of enthusiasm just what cool things you could do with haskell, and patiently deal with my (I’m sure trivial) neophyte questions. He’s honestly one of haskell’s best features, if you ask me.

                                              1. 2

                                                I have also found him to be very friendly and helpful.

                                              1. 15

                                                We’ve been hiring Haskell employees at Originate here in NYC, and the note about hiring Haskell employees is completely correct. We put up one comment on the once-a-month /r/haskell jobs thread and connected with several enthusiastic candidates in the subsequent week – over a dozen once you include applicants who inquired about remote work. These are high-quality people that any company would be lucky to have: contributors to open source libraries, generalists who know the usual imperative languages, hobbyist type theorists, and more. The takeaway is that there are functional programmers out there who are keeping an eye out for the next place to work. Throw money at them!

                                                1. 12

                                                  I had a hard time hiring Haskell people in Chicago, but this was probably an employer-side issue. (Finding good people is not the same thing as finding good people that your employer is willing to pay for, at an appropriate level.) If you’re going for top-shelf individuals, Haskell’s great for attracting them. If you’re looking for Scrum drones, not as well.

                                                  I did find that teaching Haskell is a lot easier than people make it out to be. If you have decent internal talent, people can learn it.

                                                1. 9

                                                  Go to your loved ones. Whisper sweet nothings into their ears. Remember where you were when types and kinds were unified.

                                                  See here for an HTML version of the release notes.

                                                  1. 3

                                                    So essentially this whole thing was one big publicity stunt for his company?