Tag: JavaScript
-
Adding a custom script to an Unbounce landing page
When asked if I knew how to add a custom script to an Unbounce landing page. I have never used Unbounce before, but I’ve worked with enough marketing tools that I figured I could figure it out. Also, figuring out stuff lends itself to new blog content. And here we are. Edit your page If…
-
Stop ESLint from searching up the directory tree
For most projects, I use a monorepo, and nest my scripts in a directory. I’ll npm init each script, and maintain an isolated set of dependencies outside of the main dependency tree. This includes maintaining a separate .eslintrc file as well. Typically, this isn’t a problem, but recently with a new project that was created…
-
Airbnb style guide with Next.js
Starting a fresh Next.js project the other day, I was happy to see that configuring eslint was part of the bootstrapping process. Where things fell short for me, was the lack of a prompt asking me which style guide I’d like to use. I’m sure the out of the box option is sufficient enough, and…
-
Bitcoin price tracking widget for iOS with Scriptable
Of the crypto apps I have used, I’ve yet to find one that provides a Bitcoin price tracking widget to my liking. I’m not interested in the current price of Bitcoin, as I am interested in how my holdings (HODLINGS) are doing. Thus, enter Scriptable, an automation app for Apple devices. It allows you to…
-
Node.js REPL history
Node.js has included a persistent history with it’s REPL (real-eval-print loop) for quite some time now. It’s a fantastic quality of life feature, and it even supports reverse-i-search. The other day, I got to wondering, where the heck does this history even live? Turns out, it’s just living in a…
-
How to convert JSON to CSV in JavaScript
Last week we discussed converting CSV to JSON in JavaScript. This week, we’re going to talk about going in the opposite direction, converting JSON back to CSV. Similar to last week, we’re going to use the immensely popular papaparse library. As it turns out, even though it’s touted as the…
-
How to convert CSV to JSON in JavaScript
Parsing CSV data isn’t as easy as splitting the string up into individual lines, then splitting it by the delimited (in this case commas). Some of the values may have quotes around them, sometimes the values themselves have line breaks. Then there’s the potential that the data itself is malformed….
-
How to display a JavaScript array in HTML
From time to time, I see a search query that made it to my blog that piques my interest and inspires a post. This is one such post. How does one take an array (presumably in JavaScript) and display it in HTML? Now in this day in age, I would…
-
Splitting strings and keeping the separator in JavaScript
When splitting strings, the majority of the time, I don’t care about the separator (or delimiter), just the strings that exist between it. In JavaScript, that’s very simply with .split(): ‘one,two,three,four,five’.split(‘,’); Which will yield an array of strings like this: [‘one’, ‘two’, ‘three’, ‘four’, ‘five’] Great! But if we want…
-
Repeating Strings in JavaScript
While cleaning up some of my old notes today, specifically stuff I jotted down that would make for a good blog topic, I happened upon the topic of repeating strings in JavaScript. Things are really easy in ES6+, but if you happen to still support Internet Explorer for some crazy…