The math module in Nushell has a lot of useful commands to work with numeric values. You can use the math sum command to calculate the sum of a multiple numeric values. The input of the command can be a list of numbers, durations, file sizes, or a range or table with columns containing numeric values. The result is a single numeric value with the sum of all values in the input. The math sum command can also be used on a table with multiple numeric columns. It will return a record with the sum of all values for each column.
Continue reading →
In Nushell we can use a lot a math related commands to get for example the minimum and maximum values of a list of numbers. In the math module you can find the commands math min and math max. You can use these commands to get the minimum and maximum values of a list of numbers, durations, file sizes, a range and tables.
Continue reading →
Two years ago,
we wrote about building a Slack bot
to automatically tweet new JDriven blog posts, and inform us about this using our dedicated internal Slack channel.
Life was simple then. If it was on Twitter, it was "online".
But the social media landscape has fragmented and augmented.
The tech community has spread, at least across X, Mastodon, and Bluesky.
So to reach our audience today, we have to tweet, toot and who knows what to reach them.
We needed to upgrade our trusty Slack bot from a single-channel poster to an omnichannel syndication engine.
In this post, I’ll walk you through how I refactored our Deno-based Slack app to handle multiple platforms,
manage distinct authentication protocols, and ensure we don’t spam our followers with duplicate posts.
Continue reading →
To check if a string value starts or ends with a given string you can use the str starts-with and str ends-with commands. The command returns a boolean value: true if the string starts or ends with the given string and false otherwise. The commands are case sensitive by default. You can use the --ignore-case (or the shorthand -i) to ignore casing while checking if a the string starts or ends with a given string.
To input can be a string value and then that string value is checked. If the input is an array of string values, then each element is checked. It is also possible to check values in a record or table. You need to pass the names of the field(s) or column(s) that you want to check the string values of.
Continue reading →