JAVASCRIPT PLAYBOOK

Learn some great one-liners to use on your next project

Javascript syntax and built-in methods allow us to cut down a lot of unnecessary lines in our code and write short, easily readable code. In this post, we are taking this simplicity another step forward to see where you can write one-line solutions to some common use cases and problems you’d encounter in web development. Don’t hesitate to steal these 15 Javascript one-liners to write quick and simple code for your applications.

Reverse a String

You can reverse a string in one line using split, join, and reverse methods.

const stringReverse = str => str.split("").reverse().join("");stringReverse("Welcome to Javascript")
//tpircsavaJ ot emocleW

Get the Average of an Array of Number

Javascript reducer…


Bootstrap a Node.js & MySQL application using Docker Compose

Image by the author

Docker has become a tool that developers can’t live without in less than a decade since its release. Docker provides lightweight containers to run services in isolation from other processes in the system. If you haven’t yet been properly introduced to Docker, follow our introduction to Docker guide before continuing with this tutorial.

In today’s tutorial, we are going to learn how to containerize applications that require more than one Docker container with Docker Compose. Though it’s possible to set up this system with only Docker, we can complete this task more easily and efficiently using Docker Compose.

Let’s get…


Learning new skills has never been easier; stop procrastinating your journey into tech, start NOW!

Image by the author

Some links may be affiliate links. This means if you click on the link and purchase an item we may receive commission at no extra cost to you.

I often hear or talk to people who want to get into tech, who want to learn to code, but they are terrified of its idea. It is common for people to think that to be a programmer, a web developer, you have to be a computer nerd, genius, or have some kind of innate talent for computer science, and it couldn’t be any more wrong.

Sure, computer science is a super…


Level up your Googling skills with these tips

Drawing of Google search bar
Drawing of Google search bar
Image by the author.

Google has become so integral in our lives that we now use the verb “Google” to refer to the action of using this search engine giant. Using a few chosen keywords, you can find everything from the nearest grocery store to the latest developments in the world.

Sometimes, though, the magic of Google fails to give us the type of results we are searching for. You try different combinations of keywords and go deep into the search results but still fail to find what you want.

But did you know that Google provides options to refine your search and filter…


This topic is super trendy in interviews, so you should know it if you are looking for a job

Graphic with a person pointing to question marks, a flowchart, an hourglass, and the words “time and space complexity”
Graphic with a person pointing to question marks, a flowchart, an hourglass, and the words “time and space complexity”
Image by the author

There’s more than one way to solve a problem, but not all of them are the best. Not every solution is capable of efficiently using our resources. Therefore we need to find the best, most efficient solution to a problem before taking action.

In programming, we can’t leave the mechanism of finding the best solution, the best algorithm, to guesswork. We need a clear standard to evaluate the efficiency of solutions. This is where the concepts of time and space complexity step in. They help us determine the algorithm’s efficiency based on the required resources.

In this article, we are…


Harness the power of Python with data and Leaflet.js on mapping to create rich map visualizations

aerial view of hot air balloons hovering over a city
aerial view of hot air balloons hovering over a city
Photo by Zola Zhou on Unsplash

Folium is a Python package that combines all the spectrum of tools Python offers to manipulate data with the Leaflet JavaScript library to create rich and interactive maps.

As usual for my articles, I’m providing a Google Colab Jupyter notebook with all the code and results.

Create a Basic Map

Before we start building anything, let’s install some libraries that we will be using throughout the tutorial. You can use any packaging tool. I’ll provide the examples for Pipenv and for pip prepending !, so that it works on Jupyter notebooks, like Google Colab.

pipenv install folium pandasOr!pip install folium pandas

After…


Hi Billy, apparently I did miss on a great keyboard. I wrote about those keyboards from personal experience, and I did not know the moon lander. I'll try to get my hands in one of those, and perhaps will be included on the next update.

Thanks for sharing


Popular programming languages that you can start your coding journey with

the words “choosing your first programming language” and some graphics related to learning, e.g. books, a light bulb
the words “choosing your first programming language” and some graphics related to learning, e.g. books, a light bulb
Image source: Author

Choosing our first programming language is a dilemma most of us have gone through when we were taking our first, tentative steps on this programming journey.

Your first programming language becomes a deciding factor that shapes your impression of programming itself. And it could be the thing that convinces you to continue further or abandon learning programming completely.

So if you are someone entirely new to programming, hoping to dip your toes into the field to see what all the buzz around it is about, you have to be extra careful when picking the first programming language.

Your reasons for…


Learn how to do sentiment analysis by going over Elon’s tweets

Picture of Elon Musk and Twitter’s logo
Picture of Elon Musk and Twitter’s logo
Image by the author.

A few days back, we did an introduction to NLP with Python that got some really positive feedback. Thus, I decided to write about a use case of NLP that I love: sentiment analysis.

Though we already covered a bit of what it is and how it can be used with Python, today we will review the topic in more detail and work with actual data and practical examples. We will be working with text data from Twitter, so I’m sure it will be fun!

As usual, you can follow all the steps using the following Jupyter Notebook, or you…


RESOURCES

Keyboard recommendations for developers

Some links may be affiliate links. This means if you click on the link and purchase an item we may receive commission at no extra cost to you.

As developers we don’t need many tools to work, many would say that we just need a laptop or computer, and even though that’s true, there’s a difference between having the minimum required to work to have the tools that you need to work comfortably, productive and healthy.

Today we are going to discuss keyboards that you would love as a developer. …

Juan Cruz Martinez

I’m an entrepreneur, developer, author, speaker, and doer of things. I write about JavaScript, Python, AI, and programming in general.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store