Fun stuff and announcements about testing, Python, ReasonML, etc. in this episode of This Week I Learned!
Fast, easy and reliable testing for anything that runs in a browser.
Cypress is a new way to your web applications. Personally, I think it replaces my use cases for Selenium and it is faster, prettier, and easier to use. Here are my favorite features of Cypress:
- Doesn't use a WebDriver.
- It has a pretty GUI.
- You don't need to explicitly tell it to wait. It automatically does so.
- The tests reload when you change your test code.
- You can see the tests as they happen and you can step back through the testing process.
- It creates a video of the testing process if you run it without the GUI.
The world's simplest facial recognition api for Python and the command line
If you want to do facial recognition and you know Python, look no further. Adam Geitgey's face_recognition library is very easy to use and pretty accurate. Just look up the docs and you'll immediately know what you need to do.
If you're into Reason and those kinds of notebooks, you'll be pretty happy with Sketch.sh. Sketch allows you to create ReasonML and OCaml interactive notebooks. This would be great if you want to teach and learn ReasonML interactively especially since it is pretty new.
Have you ever wrote documentation and found out that the code examples in your documentation no longer work because the code was updated?
Elixir eliminates this problem by having what we call doctests. Basically, when you add code snippets in your documentation and you configure it to work with doctests, Elixir (ExUnit, specifically) will make sure that the snippet works. If the value isn’t as expected, the tests will fail. This makes sure that the documentation you have actually matches the software you have written.
Pretty cool! Another reason to switch to Elixir! 😄
If you’re a geek like me, you like creating slides with code because it’s cool! But building it in something like HTML is a bit time consuming and complicated so we sometimes just resort to using Markdown to make things simple. But Markdown isn’t omnipotent. If you want to add interactivity, it’s game over.
Luckily there’s mdx, which allows us to create Markdown documents with JSX! Now we can add interactivity and “web components” in to our documents. Now, mdx allows us to create interactive documents, but what about slides? mdx-deck solves that problem for us by allowing us to create slide decks using mdx syntax. So we can create some React components and show them in action in our slides. You can even change the theme using the ones included or create your own theme. Have fun making your slides with mdx-deck!
I’ve been playing around with ReasonML for a while and so it doesn’t come as a surprise that I tried building a library in Reason. So, I built reason-maybe, which is a Maybe monad implementation in Reason. For most cases, you can just the optional type in Reason but if you want chains/flatMaps, etc., this is a pretty okay one to try.
Stencila is another interactive notebook software for building reproducible research. This combines something like MS Excel and Word, plus the ability to code in Python and Node. It also looks a bit cleaner. This is definitely a pretty interesting one to try, although I feel that it isn’t quite ready yet. But do definitely give this a try.
If you have difficulty picking the stack for your project, or you don’t know what your choices are, you can try out DryStack. You can check out some tech stack options for client, server, tooling, etc. If you don’t know where to start, this is a pretty good starting point.
GraphQL is a young piece of technology and there are still a lot of problems with no industry standard method of solving. One of those problems in caching. While Facebook has created a solution for this, namely dataloader, it only caches exact requests. A new contender, FlacheQL, allows partial retrieval of a cached result. This is definitely pretty nice because you don’t have to fetch everything if the query does not exactly match the query that was cached. This will make caching with GraphQL more efficient.
If you’re bored with the usual PHP/Java/C#/Node approach to developing web APIs and want something more hard core, try out Kore! It allows you to build web APIs in C.
If that isn’t hardcore enough, I don’t know what your definition of hardcore is.
But still it is an interesting concept, and we all know how fast C is. So definitely try and check this out, if you dare.