1. 26

  2. 7

    The instructions for how to use the cheat sheet seems to be as long as the actual cheat sheet.

    1. 3

      actually simply:

      curl cht.sh/COMMAND
      curl cht.sh/LANGUAGE/QUESTION

      The rest is optional.

    2. 3

      I was worried this would be another bropages or tldr or devdocs, but this is kinda awesome - the shell script & editor plugins are a nice touch because I think most people would rather not memorize its curl pipeline.

      1. 1

        The curl pipeline is pretty obvious actually. There is not so much to memorize. But the shell client is a good thing still

      2. 1

        Can someone with cognitive science back me up on my gut feeling? Everyone has a hard time learning new skills and everyone uses search engines occasionally, but going to these lengths to cheat actually impair learning.

        Unless you count learning how to use the cheat sheet as a valuable skill.

        1. 7

          I never thought of cheatsheets as literally cheating, more like terse examples of tried and true patterns (in other words not cheating but preventing inventing the wheel over and over again).

          1. 3

            Absolutely right! And I was feeling guilty while creating cheat.sh. That is why we have developed some countermeasures. If we manage to implement this, cheat.sh will have the most important feature of any real cheat sheet: it will help not really to cheat, but to learn too.

            Thank you for this your comment. That is actually the comment that made me register here. This is a very very deep and important thought. Thank you

            1. 2

              There is difference between learning skills and memorizing small details (which are irrelevant in bigger picture). Cheatsheets help with latter.

              1. 2

                The stuff usually found on cheat sheets is “How do I reverse a list in Python?” and not some insanely advanced skill.

                Usually the answer is something inefficient and misleading, when it should be “Mu! You do not.” - and even then it’s not a hard thing to learn.

                Learning how to deal with your language’s and framework’s etc reference manuals, now that’s a worthwhile skill. A gift that keeps on giving.

                1. 1

                  But it could potentially also grow the cargo-cult culture of programming: those who don’t understand the language and don’t care, but copy and paste snippets together and bash on it until they reach some definition of success. The snippets are helpful reminders for those familiar with the deep details, but could be uninformative and relatively context-free crutches that only hobble newer programmers from understanding why that particular snippet needed to be different to be the right answer to their actual problem, in the context of the code they’re actually working on.

                  1. 2

                    The snippets are helpful reminders for those familiar with the deep details


                    Sometimes I use snippets for complex operations that I don’t really care about.

                    I think this is a great example. https://stackoverflow.com/questions/39799999/parsing-a-soap-message-using-xpath-in-java

                    Let it suffice to say that I need that for some reason, and it’s not performance critical, and I fully understand that I’m going to get really deep call stacks and great gooey gobs of complex objects in memory during runtime. I can picture some approximation of it in my mind. (I use rectangular prisms, nested like Russian dolls, in primary colors, megabytes upon megabytes of them, and the tiny little strings that are actually useful data are glowing, everything else is dusty-translucent.)

                    I’m also going to literally println a CSV file on the other end, throw it in a Scheduled Task (no, I didn’t say cronjob), and move on to a more important project.

                    Using the snippet is the right choice for this part of this project. All I need are those little (glowing) strings.

              2. 1

                I’ll come back later and edit this comment with links; but if this is a suitable replacement for the defunct cheat.errtheblog.com gem, I shall be very happy indeed.

                1. 2

                  Too late to edit, so here’s a reply, instead. Re: the cheat gem:

                  • it turns out that Chris Wanstrath’s (cheat)[http://errtheblog.com/posts/21-cheat] from 2006 still works! gem install --user cheat; cheat cheat, and away you go. Some features don’t work, though: cheat sheets and cheat recent to show all (recent) sheets both get 404 errors.
                  • cheat --edit sadly does not currently work. The --edit option was the best thing about the cheat gem: it was a command-line wiki, not a lookup tool.

                  Re: cheat.sh:

                  • cheat.sh isn’t wiki-like, but serves content from various cheat sheet repositories, instead. Some repos get special URLs: /:learn returns the relevant https://learnxinyminutes.com lesson, for example.
                  • cheat.sh does let you edit sheets in the browser, though, and will auto-submit merge requests.
                  • Nifty syntax highlighting, too.
                  • Also, does cheat.sh have hierarchical namespaces? Running cht.sh python/:list returned a short list of entries, including doc, that suggested that, but the servers overloaded before I could check cht.sh python/doc/:list. My experience with wikis both flat and nested has led me to strongly prefer flat namespaces over nested ones for general reference works, but good search covers a multitude of sins.