You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a description of how I write tech articles for various blogs.
Hopefully someone else will find this useful as well.
Create a Gist for the article
When I begin writing a new article,
I create a new [GitHub Gist][gist] for the article files.
The Gist contains a file for the article text and code examples related to the article.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are multiple strategies for error handling in Scala.
Errors can be represented as [exceptions][],
which is a common way of dealing with errors in languages such as Java.
However, exceptions are invisible to the type system,
which can make them challenging to deal with.
It's easy to leave out the necessary error handling,
which can result in unfortunate runtime errors.
In Clojure, data structures are mostly built from a handful of core data structures such as lists, vectors, maps, and sets.
This means that most data structures can leverage all of the generic data transformation and querying functions built for the core data structures instead of having to rebuild the same functionality for each data structure.
This feature in combination with Clojure's rich standard library makes Clojure very attractive for solving data munching problems from other domains.
In this article, I'm going to demonstrate these capabilities for solving HTML transformations using Clojure.
First, I'm going to describe how HTML can be represented in Clojure.
With this representation in mind, I'll demonstrate how we can transform HTML documents in Clojure.
Finally, I'll tie the transformations together with the HTML parsing and formatting to produce a complete solution.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Script that downloads Youtube playlist and extracts the audio from the downloaded clips.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scala provides many tools to help us build programs with less runtime errors.
Instead of relying on nulls, the recommended practice is to use the Option type.
Instead of throwing exceptions, Try and Either types are used for representing potential error scenarios.
What’s common with these features is that they’re used for capturing runtime features in the type system,
thus lifting the runtime scenario handling to the compilation phase:
your program doesn’t compile until you’ve explicitly handled nulls, exceptions, and other runtime features in your code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters