Ruby Heredoc Tutorial
A heredoc can be a nice way of passing a large block of text around in a script. Here are a few tips on using heredocs with Ruby.
Advertisement
Advertisement
A heredoc can be a nice way of passing a large block of text around in a script. Here are a few tips on using heredocs with Ruby.
The rake
utility and Rakefile
are Ruby's version of make
and Makefile
.
Personally, I find rake
much more pleasant to work with than make
.
While it is written in Ruby, you can use it as task runner for a project
of any language. Let's look at some basic usage of rake
.
If you are trying to run your Node.js application and you get something like this:
Error: Cannot find module 'C:\Users\Me\my_app.js'
then you are most likely trying to run the wrong file. It is possible
you are missing a dependency that is needed from npm install
,
but if it says it cannot
find the main file you are trying to run, then you are
trying to run a file that does not exist. It is a common mistake.
This tutorial will walk through the basics of Python 3 virtual environments. The official documentation is available at https://docs.python.org/3/library/venv.html. All of these commands are run from your command prompt/shell/terminal, not from within Python.
Recently I needed to take my front end development skills to the next level. Whenever I needed to build a web interface, it was simple enough to use Bootstrap and the jQuery that came packaged with it. This worked fine when the templates were being rendered server-side using templates like with Django, Flask, WordPress, etc.
The better way to make web applications these days though is to have a separate REST API running the back-end, and then have a front-end that consists only of static HTML, CSS and JavaScript that interact with the API using AJAX calls.
I decided to take the time to learn Angular, React, and Vue.js enough to form an opinion and understand the benefits and drawbacks of each one. This is my comparison and conclusion. I chose Angular and I will explain why.
For reference:
In search of the perfect desktop Linux distribution I have tried out quite a few and learned about the philosophies of each one. This is my comparison of some of the distributions I have tried over the years.
I will spoil it now and let you know that the winner in my book is Fedora!
When attempting to use SSH client in Fedora 29 within a VMWare Player virtual machine, I would receive a a broken pipe error immediately after a successful authentication request. This is the fix I found.
Bash brace expansion is an incredibly valuable feature once you commit it to memory and begin using it on a regular basis. It will save you immense amounts of typing. This also works in Zsh.
Coloring your terminal output in a command-line application can make a big difference in readability. This will show you how to format your text in a Ruby application.
We will use the colorize
gem, which works in Linux, Mac, and Windows too.
Colorize works by adding the ANSI escape characters to set colors.
If you have a script or application you want to run but don't have a desktop or dock launch icon for it, you can create a custom one yourself.
This will work in Gnome, KDE, and other desktops that follow the specifications at freedesktop.org.
For more options, you can read more about Desktop Entry Specifications.
Advertisement
Advertisement