1. 8

    git features I started using, but only after a while:

    • git pull --rebase
    • git commit --fixup <hash>
    • git rebase -i --exec=<run the testsuite>
    • git rebase --onto <ref> <hash> <ref>
    • git stash --include-untracked
    • git rebase -i --root
    1. 4

      I was really hoping git commit --fixup would be in the original post - that’s the number 1 git command I recommend to new users

      1. 3

        What does it do?

        1. 9

          I usually market it as “the easy way to git commit --amend something other than the most recent commit”.

          In more detail, git commit --fixup <ref> creates a new commit annotated to be a “fixup” commit of the given commit ref. A subsequent git rebase -i --autostach <some commit before ref> will automatically move that commit to directly after <ref> and turn it into a fixup rather than a pick, meaning it will be merged into that commit and its message will be discarded.

          Emacs+magit users can get the whole “fixup-and-autosquash” dance in a single step with c F (magit-commit-autofixup), which gives you a git log to choose the target commit from and runs the autosquash in one go, which is one of those user experiences which genuinely feels magical the first time you try it (magit is full of them!)

          1. 2

            Thank you for explaining!

          2. 1

            I’ve written about this at https://www.jvt.me/posts/2019/01/10/git-commit-fixup/ if you fancy a bit more of a read

          3. 2

            also git rebase --autosquash

        1. 1

          I practice something I call Blogumentation - blog posts as a form of documentation which means I’ll post a blog post for a lot of new learnings, or non-trivial things I’ve done. It’s working pretty well, cause others get to use the resources too, as they’re tagged blogumentation on my site

          1. 1

            As someone involved in the IndieWeb Movement I use Aperture which supports many types of feeds (RSS, JSON Feed, Microformats) which provides a backend that I can then use with a whole host of clients to actually read the content, which is primarily Indigenous for Android or Monocle

            1. 1

              As I’ve written about in my own post about this there are caveats to be careful about - you need to add an =$ref to actually prevent overwriting, if you git fetch often

              1. 10

                My usual thought when I see “XXX in only YY LoC” is to ask what packages are imported and just how large are those? But after reading this I didn’t care there’s another 180 lines of magic imported from hmac because of how great the documentation is.

                This is seriously worth a read, whether or not you are writing in python (I generally don’t) or care to play code golf (occasional pasttime). The README.md is 700 lines to explain everything about the 20 LoC in the implementation, and the tests are a further 80 LoC. That means you’ll learn a lot from this about TOTP in general and, if you’re a Python user, all the ways you can make use of this for your own code.

                Thanks for sharing!

                1. 2

                  Thanks for posting this reply, because I was going to potentially skip it for the same reason - I’m glad I didn’t!

                  1. 1

                    Thank you for the kind words and appreciating the documentation.

                  1. 5

                    Jq can parse the jwt payload for you if you just need to look inside. No need to reach for jwt.io or anything else, in that case

                    1. 3

                      Yes that’s true. A few of my colleagues use that, but as mentioned in a linked post, I use python -mjson.tool as it doesn’t need jq installed

                    1. 11

                      What’s with this assumption of being a worldwide authority or known entity that’s so popular in blog posts or internet comments?

                      My thoughts on…

                      I’ve always maintained that…

                      Like many people know…

                      People who know me know that…

                      I’m infamous for…

                      Nobody knows who you are - just write your content without the preamble.

                      1. 60

                        I don’t think a blogger owes anyone being overly modest on their own blog. They can write however they like. I’m going to read it as long as it’s useful and/or entertaining.

                        1. 29

                          I thought it was perfectly fine? They have discouraged and discussed this kind of online tooling, and eventually decided to write it up as a blog post. It’s perfectly reasonable to frame this article as the author’s reasoning behind doing what they’re doing.

                          In fact, I’d argue it’s more modest than something like “why online tooling is bad”. With the author’s framing as it is, they’re not pretending to have the objectively correct view; they’re upfront about how this is their opinion on the matter.

                          1. 2

                            That’s true as well. “JWT.io considered harmful” would be a worse post, and the personalisms clearly draw the line between “this is my opinion” and “I speak for everybody”.

                            My original post probably crossed wires between “authority” vs. “familiarity”

                          2. 16

                            You seem like you must be a worldwide authority on how to write preambles for blogs. ;)

                            1. 1

                              Why would he need to be?

                              1. 4

                                He wouldn’t, but as others have cited, being overly critical of someone’s writing because of their particular language choices and not commenting at all on the content being presented is A) Of questionable constructive value and B) Potentially not in the spirit of this very technology oriented forum.

                            2. 14

                              I’m sorry that you read it like so - would you mind explaining what wording made me sound like I think I’m a worldwide authority on the matter?

                              1. 9

                                You’re all good, you have your own voice. It’s some BS that this is the feedback you’re getting unsolicited instead of talking about the actual topic.

                                1. 4

                                  Given the reaction, I’m probably in the wrong here. It’s a minor nit that I magnified into a big deal.

                                  Buuut, to explain my rationale, it’s specifically your first paragraph. The content was fine (and I use jwt.io often).

                                  Something my colleagues know well is how little I trust online tools like jwt.io, online JSON validators or online tooling in general, but it also bleeds into comments I make online and in my blog posts, too, and I thought I’d share a little bit of a reason as to why.

                                  I’m not familiar with your coworkers, your online comments, or your blog posts. And I don’t mean that offensively, like “you’re a nobody” - it’s just that in this case I would rather tailor the article for what’s probably the larger group (people who don’t know you) vs. the smaller group (people who know you).

                                  My reaction was overblown, and contained more of a general rant towards every instance of this I’ve seen, not your specific violation.

                                  To be frank I’m surprised that others disagree (although it’s probably more about me sounding like a dick than my opinion). I genuinely find it strange to read public content that’s written as if I’m this person’s best friend and remember the thing they said in the kitchen last Tuesday.

                                2. 5

                                  On the other hand, I dislike when people speak for me on my behalf with phrases like “the python community agrees that” or “all java developers think that”.

                                  I also think it’s important to separate things that are factual from opinions. It’s not that my opinion is important but that it’s just an opinion, and everyone can have one. Disagreeing does not necessarily make you wrong when it comes to opinions, but more so when it comes to facts.

                                  1. 1

                                    “Or, as I’ve lately taken to calling it, …”

                                    It’s weird though — these phrases didn’t start out as imitation of people with actual authority, as far as I can tell. A lot of fake authority starts as imitatiion (e.g. dressing like the king/CEO/next-rung manager), but I can’t recall widely respected people like DHH (recently) or JKH (decades ago) ever using phrases like “Like many people know”. These phrases were always fake.

                                  1. 2

                                    I’m not familiar with the Netlify CLI, but isn’t this deploying to a “branch” (separate URL) rather than a branch, which I initially interpreted as a Git branch? In any case, this sounds like a tremendously useful feature for CI.

                                    (Edited to mention my comment is probably a nitpick :P)

                                    1. 2

                                      Good point - this is exactly that. Allowing you to deploy to a separate URL, for instance if you were building a branch on CI.

                                      1. 15

                                        It’s worth reading Aaron Parecki’s detailed writeup about this as there’s a bit more info about what actually went wrong

                                        1. 2

                                          That was a good read. The only issue was lack of server-side validation.

                                          1. 1

                                            An amazingly big issue for such an important feature.

                                        1. 2

                                          Is there an RSS feed by default? It’d be good to subscribe, but I can’t find it automagically with my feed reader - it may be its missing rel=alternate?

                                          1. 6

                                            I’m quite heavily into the IndieWeb movement, in which we’ve designed a new standard Microsub which allows for a slightly better API than “regular” RSS/Atom readers, as it allows for you to use different feed formats on the backend. It also splits between the client and the server quite nicely, so I can use Indigenous for Android when on the move, and Monocle when I’m on the desktop. The best thing about the standard, aside from allowing extensible feed parsing, is that I can use different clients to read it, instead of relying on a single provider - which I believe we’ve seen with some of the RSS/Atom readers around currently.

                                            The server I use is Aperture, built and run by Aaron Parecki, and I subscribe to a mix of RSS/Atom, JSON Feed and Microformats2 feeds

                                            1. 1

                                              For those wanting a bit more info on the IndieWeb, see the discussion and post on https://lobste.rs/s/zg6iok/indieweb_movement_owning_your_data_being where I shared a transcript of a conference talk I did on the subject

                                              1. 1

                                                Never heard of it before, but looks promising. I will give it a try!

                                                Is it possible to have webmentions as a comment seciton on a static website?

                                                1. 1

                                                  There’s https://webmention.io/ or you can have a self-hosted service somewhere.

                                                  1. 1

                                                    I believe so. I know a couple of people who are running Hugo and have this. However, I would assume that that the comments are updated only when the site is regenerates, rather than on-the-fly like WP.

                                                    1. 1

                                                      I use https://github.com/PlaidWeb/webmention.js to render my webmentions client-side so they’re always up to date, instead of needing to rebuild the site - I’ve written a bit more about it at https://www.jvt.me/posts/2019/06/30/client-side-webmentions/

                                                    2. 1

                                                      You can, but like anything dynamic, you’d either need to implement the comments section in client-side JavaScript or else have some way of triggering your site to rebuild and redeploy whenever a new Webmention is posted.

                                                      1. 1

                                                        I’m doing that. My site is SSG that is built on my desktop and uploaded via good old rsync.

                                                        I use this webmentions SaaS to collect my mentions and a client-side JS to fetch and display them. My design skills are limited, so you can have it looking much better than I did. This post has a lot of mentions at the end. The JS used is not minified and is at the end of the post, near line 152 if you want to check.

                                                        Another cool service is bridgy which will send and collect mentions from silos and forward to your web site. I have it configured with my twitter and mastodon account. This way, I can have it send automatic tweets or toots when I post and also deliver replies and comments back to the original post.

                                                        1. 1

                                                          Yes, it’s possible with a dynamic webmention endpoint that somehow saves webmentions. I have such a dynamic endpoint that creates a file in a git repo, commits and pushes it. That triggers a pipeline to rebuild my blog with Hugo and then a link is displayed below the page which received the webmention.

                                                          1. 1

                                                            I have done it on my static website using webmention.io. I just pull on my personal computer regularly the updates from webmention.io and then I generates the comment section using some Hugo features. Shameless plug to my blog post explaining this

                                                          1. 1

                                                            I have a script git-wipu that does a git commit --ammend without changing the commit message and then force pushes it. I use it all the time when I’m on my own work-in-progress branch and I want to “accumulate” a single commit in small chunks. It’s like my git equivalent of instinctively saving a file every ten seconds.

                                                            I also use the following aliases:

                                                            alias shelve='git stash'
                                                            alias unshelve='git stash apply'

                                                            because I can never remember git stash on the few occasions that I need it.

                                                            1. 2

                                                              I did something similar with lots of sq! {SHA} commits until I found out about git commit --fixup which let’s you do similar, and then git rebase -i --autosquash it afterwards, which is a bit safer with repos others are working on - there’s some more detail on https://www.jvt.me/posts/2019/01/10/git-commit-fixup/ if that helps!

                                                              (Originally posted at https://www.jvt.me/mf2/2020/02/s9zg3/ and hand syndicated)

                                                              1. 2

                                                                I didn’t even know that the --fixup & --autosquash flags existed.

                                                                Thanks for the link; I’ll definitely look at incorporating these into my workflow!


                                                            1. 1

                                                              I’d thoroughly recommend https://gatling.io/ as we’re using it across both Java-based and non-Java-based APIs, and have found it pretty great.

                                                              I know we’re not using nearly the power it affords, but it’s very good!

                                                              You don’t need to know that much Scala too, it has a straightforward DSL before you get there

                                                              (originally posted at https://www.jvt.me/mf2/2020/01/utfz2/ and hand syndicated)

                                                              1. 1

                                                                I’ve also used Gatling, and it should do what you need.

                                                                I’m not as thrilled about it: parts of the API are a little hard to make work the way you want, but it has all the major capabilities I’ve needed.

                                                                I also agree about Scala not being a huge obstacle if you work in Java, though when I’ve had to dig into the Gatling code to understand things, it has slowed me down a bit.

                                                              1. 7

                                                                I remember all the semantic web hype from when I was a baby programmer new at a professional job. I rolled my eyes then, and I was mostly right. Mostly.

                                                                Stuff like knowledge graphs, hashtags, etc. that are used a lot today did come out of that though, so it wasn’t a total loss of good people’s time.

                                                                1. 12

                                                                  I think that the semweb stuff is the poster child for what happens when you come up with a good idea, make it too complicated, and then freak out when simpler approaches come along and in so doing doom yourself to irrelevance.

                                                                  1. 3

                                                                    come up with a good idea, make it too complicated

                                                                    I was just looking at some IndieWeb stuff, Falcon to be specific, and the learning curve is huge for what are relatively simple things in practice. That page and some others I found require a lot more effort than they should probably require. It’s a noble effort, but it’s very hard to get people onboard if they don’t have a lot of energy to apply.

                                                                    1. 2

                                                                      Agree that some users won’t want to get stuck into it - they’re likely also the users who won’t be writing raw HTML for their sites.

                                                                      So what we’re doing for them is getting Microformats2 support directly into the themes for WordPress, Jekyll, Hugo, etc, so anyone using it can benefit without necessarily doing any work!

                                                                      (originally posted at https://www.jvt.me/mf2/2020/01/an68d/ and hand syndicated)

                                                                    2. 2

                                                                      What simpler approaches came along?

                                                                      1. 3

                                                                        knowledge graphs, hashtags, etc

                                                                        1. 1

                                                                          Oh, I thought there was some other standard I wasn’t aware of.

                                                                          1. 2

                                                                            http://microformats.org/ — embed structured data in normal HTML with minimal fuss.

                                                                        2. 1

                                                                          In some way html is the simpler sgml.

                                                                          RSS is a way simpler RDF.

                                                                        3. 1

                                                                          Yeah that checks out.

                                                                          1. 1

                                                                            As shared in a separate comment in the thread, there’s the Microformats2 specification (see https://microformats.io) which reduces duplication seen with some of the other Semantic Web formats.

                                                                            You can see an example of a parsing result at http://php.microformats.io/?url=https%3A%2F%2Fwww.jvt.me%2Fmf2%2F2020%2F01%2F2mylg%2F which produces a standardised structure for the resulting JSON, which makes interconnectivity much simpler.

                                                                            Us folks in the IndieWeb (https://indieweb.org) have been using it for some time with great benefit, but it’s always great to hear others reactions too!

                                                                            (originally posted at https://www.jvt.me/mf2/2020/01/tw4ug/ and hand syndicated)

                                                                        1. 1

                                                                          Cool stuff. I wonder how do you plan to incorporate micropub with an ssg?

                                                                          1. 2

                                                                            I’ve written about how I added it to my own site www.jvt.me at https://www.jvt.me/posts/2019/08/26/setting-up-micropub/ if you’d like more info on how you’d go about it - as my site is built around Git as the source of truth, I simply need to get it committing the changes for me and that’s it!

                                                                            (originally posted at https://www.jvt.me/mf2/2020/01/b4dtn/ and hand syndicated)

                                                                            1. 2

                                                                              As I do now, when you look at the source of https://f5n.org/index.html you’ll see that I simply host it on a different subdomain. Could just make this vhost also have php support, for example.

                                                                            1. 36

                                                                              I think this will not succeed for the same reason that RSS feeds has not (or REST). The problem with “just providing the data” is that businesses don’t want to just be data services.

                                                                              They want to advertise to you, watch what you’re doing, funnel you through their sales paths, etc. This is why banks have never ever (until recently, UK is slowly developing this) provided open APIs for viewing your bank statement.

                                                                              This is why businesses LOVE apps and hate web sites, always bothering you to install their app. It’s like being in their office. When I click a link from the reddit app, it opens a temporary view of the link. When I’m done reading, it takes me back to the app. I remain engaged in their experience. On the web your business page is one click away from being forgotten. The desire to couple display mechanism with model is strong.

                                                                              The UK government is an exception, they don’t gain monetary value from your visits. As a UK citizen and resident, I can say that their web site is a fantastically lucid and refreshing experience. That’s because their goal is, above all, to inform you. They don’t need to “funnel” me to pay my taxes, because I have to do that by law anyway. It’s like reading Wikipedia.

                                                                              I would love web services to all provide a semantic interface with automatically understandable schemas. (And also terminal applications, for that matter). But I can’t see it happening until a radical new business model is developed.

                                                                              1. 5

                                                                                This is why banks have never ever (until recently, UK is slowly developing this) provided open APIs for viewing your bank statement.

                                                                                This has happened in all EU/EEA countries after the Payment Services Directive was updated in 2016 (PSD2). It went into effect in September 2019, as far as I remember. It’s been great to see how this open banking has made it possible for new companies to create apps that can e.g. gather your account details across different banks instead of having to rely on the banks’ own (often terrible) apps.

                                                                                1. 6

                                                                                  The problem with PSD2 to my knowledge is that it forces banks to create an API an open access for Account Information Service Providers and Payment Initiation Services Providers, but not an API to you, the customer. So this seems to be a regulation that opens up your bank account to other companies (if you want), but not to the one person who should get API access. Registration as such a provider costs quite some money (I think 5 digits of Euros), so it’s not really an option to register yourself as a provider.

                                                                                  In Germany, we already seem to have lots of Apps for management of multiple bank accounts, because a protocol called HBCI seems to be common for access to your own account. But now people who use this are afraid that banks could stop this service when they implement PSD2 APIs. And then multi-account banking would only become possible through third-party services - who probably live from collecting and selling your data.

                                                                                  Sorry if something is wrong. I do not use HBCI, but that’s what I heard from other people.

                                                                                  1. 1

                                                                                    I work on Open Banking APIs for a UK credit card provider.

                                                                                    A large reason I see that the data isn’t made directly available to the customer is because if the customer were to accidentally leak / lose their own data, the provider (HSBC, Barclays etc) would be liable, not you. That means lots of hefty fines.

                                                                                    You’d also likely be touching some PCI data, so you’d need to be cleared / set up to handle that safely (or having some way to filter it before you received it).

                                                                                    Also, it requires a fair bit of extra setup and the use of certificate-based authentication (MTLS + signing request objects) means that as it currently sits you’d be need one of those, which aren’t cheap as they’re all EV certs.

                                                                                    Its a shame, because the customer should get their data. But you may be able to work with intermediaries that may provide an interface for that data, who can do the hard work for you, ie https://www.openwrks.com/

                                                                                    (originally posted at https://www.jvt.me/mf2/2019/12/7o91a/)

                                                                                2. 4

                                                                                  Yes, this does seem like a naive view of why the web is what it is. It’s not always about content and data. For a government, this makes sense. They don’t need to track you or view your other browsing habits in order to offer you something else they’re selling. Other entities do not have the incentive to make their data easier to access or more widely available.

                                                                                  1. 6

                                                                                    That’s very business centric view of the web, there’s a lot more to the internet than businesses peddling things to you. As an example, take a look at the ecosystem around ActivityPub. There are millions of users using services lile Mastodon, Pleroma, Pixelfed, PeetTube, and so on. All of them rely on being able to share data with one another to create a federation. All these projects directly benefit from exposing the data because the overall community grows, and it’s a cooperative effort as opposed to a competitive one.

                                                                                    1. 3

                                                                                      It’s a realistic view of the web. Sure, people who are generating things like blogs or tweets may want to share their content without monetizing you, but it’s not going to fundamentally change a business like a bank. What incentive is there for a bank to make their APIs open to you? Or an advertiser? Or a magazine? Or literally any business?

                                                                                      There’s nothing stopping these other avenues (like the peer-based services you are referring to) from trying to be as open as possible, but it doesn’t mean the mainstream businesses are ever going to follow suit.

                                                                                      I think it’s also noteworthy that there is very little interesting content on any of those distributed systems, which is why so many people end up going back to Twitter, Instagram, etc.

                                                                                      1. 1

                                                                                        My point is that I don’t see business as the primary value of the internet. I think there’s far more value in the internet providing a communication platform for regular people to connect, and that doesn’t need to be commercialized in any way. Businesses are just one niche, and it gets disproportionate focus in my opinion.

                                                                                  2. 3

                                                                                    Aye, currently there is little motivation for companies to share data outside silos

                                                                                    That mind-set isn’t really sustainable in the long term though as it limits opportunity. Data likes to date and there are huge opportunities once that becomes possible.

                                                                                    The business models to make that worth pursuing are being worked on at high levels.

                                                                                    1. 1

                                                                                      Ruben Verborgh, one of the folks behind the Solid initiative 1, has a pretty good essay 2 that details a world in which storage providers compete to provide storage, and application providers compete on offering different views to data that you already own.

                                                                                      Without getting into Solid any more in this post, I will say that there are a ton of websites run by governments, non-profits, personal blogs, or other situations where semantically available data would be a huge boon. I was looking through a page of NSA funded research groups the other day for McMurdo station 3, and finding what each professor researched on took several mouse clicks per professor. If this data was available semantically, a simple query would be enough to list the areas of research of every group and every professor.

                                                                                      One can think of a world where brick-and-mortar businesses serve their data semantically on their website, and aggregators (such as Google Maps, Yelp, and TripAdvisor) can aggregate them, and enable others to use the data for these businesses without creating their own scrapers or asking a business to create their own API. Think about a world where government agencies and bureaucracies publish data and documents in an easy to query manner. Yes, the world of web applications is hard to bring the semantic web to due to existing incentives for keeping data siloed, but there are many applications today that could be tagged semantically but aren’t.

                                                                                      1. 1

                                                                                        The web has been always used mostly for fluff since day 1, and “web assembly” is going to make it more bloated, like the old browser-side java.

                                                                                        The world needs user-centric alternatives once again.

                                                                                      1. 6

                                                                                        I’ve thoroughly tested a lot of CI/CD services about a year back. I finally settled on GitLab CI as best choice. It requires you to host your repository on GitLab though.

                                                                                        1. 3

                                                                                          Interesting! I know a lot of people like GitLab because it’s not part of the Github/Microsoft monoculture. Was that a driving reason, or were there others?

                                                                                          1. 1

                                                                                            I’ve been using GitLab for almost 4 years now, largely for reasons stated in https://www.jvt.me/posts/2017/03/25/why-you-should-use-gitlab/ but also for all the extra stuff they’ve built on top over the years. Originally it was just because of private repos, but evolved into a love of the platform being built in a way that folks can contribute, unlike GitHub.


                                                                                          2. 2

                                                                                            Why was that your choice? What usecase?

                                                                                            I don’t love gitlab CI for the reason it isn’t accommodating of usecase it’s not designed for, and I’m stuck with both. This is obviously very different from the cases where you are in the designed usecases.

                                                                                            And actually one peeve is that it encourages the use of “fat” docker containers.

                                                                                            1. 4

                                                                                              My experience was the opposite. We went “all-in” on gitlab and love the ci process. Initially we used 2 bare runners, windows and linux, and installed whatever software we wanted on those. CI just called what it needed in those runners. Worked great.

                                                                                              All the online examples used docker and we found that adding a docker runner allowed us to do more. Now we build our own docker images to use so they aren’t “fat”, they are minimal to what that step needs.

                                                                                              Ultimately, we found that it was completely customizable to what we wanted.