Home » Articles by: Brad Morton

Why Use The Terminal [Linux/BSD]?

Why Use the Terminal?

Lots of people choose to use the terminal instead of a graphical interface for coding, system administration, and even day-to-day computing – but why? Here’s a bunch of reasons. If you’re confused about what the Terminal, Shell, and Command-Line all are – check out our explainer here! Most servers lack a GUI (If you ignore Windows) Most Linux servers are remotely administered via the terminal through a remote SSH connection – so being comfortable in the terminal by using it day-to-day makes things easier when it … Read more

Home » Articles by: Brad Morton

Ruby vs Python – Which Programming Language to Learn in 2022?

Ruby vs Python

Learning to program but aren’t sure which language to choose? Python and Ruby are popular choices. This article will provide info to help you decide. What is Python? Python is a general-purpose programming language that can be used for everything from scripting to building full-blown web and desktop applications. It’s designed to be easy to read, easy to learn, and easy to write. It’s been in development since 1991, the current version being Python 3, which is under active development. Python bills itself as ‘batteries included’ – many libraries … Read more

Home » Articles by: Brad Morton

JavaScript: Compare Strings (Optionally Ignoring Case), With Examples

JavaScript Compare Strings

This quick tutorial will show you how to compare two or more strings in the JavaScript programming language – optionally ignoring case – with code examples. What are Strings? Strings are a series of characters. Each character has an ordered position in the string. A string can be of any length – from 0 (zero) characters to as many as you need until your computer runs out of memory. Strings are a type of variable. String type variables in JavaScript are variables that can hold a string … Read more

Home » Articles by: Brad Morton

Why Using the Right Variable Type is Important (Especially in Javascript)

Programming Variable Types

Variable types are a fundamental programming concept that often confuses beginners – especially those learning JavaScript. This article will show you the consequences of using the wrong variable types. What is a Variable Type? In computer programming, the type of a variable determines what values a variable can hold and what can be done with the variable. As an example, numeric variables can have mathematical operations performed on them, whereas string variables cannot (more on this later). Different programming languages support different types of variables, … Read more

Home » Articles by: Brad Morton

How to Convert an Object to an Array in JavaScript [Examples]

JavaScript Convert Object to Array

This article will show you the ways to convert an object to an array in JavaScript – quickly and easily. There are many ways to convert objects to arrays, but these (should) be the most straightforward methods. Converting Object to Array in JavaScript – Values Only If you only need the values from the object, the Object.values() method will extract them into an array: var myObject = { colour: ‘blue’, number: 43, name: ‘Fred’, enabled: true }; var values = Object.values(myObject); console.log(values); The above will return an array with … Read more

Home » Articles by: Brad Morton

Snowflake/Muon: the Best GUI SSH Connection Manager on Linux

Muon Snowflake SSH Connection Manager

Secure, powerful remote access is one of the cornerstones of Linux’s functionality. The SSH protocol powers this, and Snowflake/Muon is an excellent tool for managing SSH connections. The flexibility and security of SSH are part of why Linux is so popular as a server OS. This article is part-introduction to SSH and part-review of the Snowflake (now known as Muon, but still referred to as Snowflake in many places). I’ve been using it for a while, and the project deserves attention! What is SSH? SSH is a secure network protocol. … Read more

Home » Articles by: Brad Morton

Converting Object to an Array Recursively in JavaScript

JavaScript Recursive Object to Array

The Object.entries() method in JavaScript can be used to convert an object to an array – but it doesn’t work recursively. So here’s a function to accomplish that. I can’t think of a reason why you’d want to do this, but it came up while putting together an article on using Object.entries() – so here it is! Recursive Function for Converting Objects to Arrays I’ll let the comments do the talking as to what’s going on. The gist of it is that (for whatever reason) you want to convert an … Read more

Home » Articles by: Brad Morton

JavaScript: Remove the First/Last Character from a String [Examples]

How to Remove First/Last Characters from String in JavaScript

This tutorial will explain a few ways to remove the first or last character (or both!) from a string in the JavaScript programming language. This can be useful if you need to capitalize names or sentences or remove punctuation. Remove First/Last Character Using The substring() Method The JavaScript substring() method can be used to remove the first or last character from a string. You can find out more about the substring() and similar substr() methods here. The below code example shows how to remove the first, last, and both the first … Read more

Home » Articles by: Brad Morton

PHP_SELF – What It Is, and Why It’s Too Dangerous to Use [WARNING]

PHP_SELF

This article outlines the PHP_SELF attribute of the $_SERVER system information variable and why you should never, ever use it. What is _$SERVER? Check out our full article on $_SERVER here – but in short, it’s a variable containing an array with information about your PHP environment – including server and request details that are quite sensitive and shouldn’t be publicly accessible. What is $_SERVER[‘PHP_SELF’] ? $_SERVER[‘PHP_SELF’] contains the full path to the PHP script being executed, including any query parameters. This allows the party making the request to include arbitrary data. Displaying data … Read more

Categories PHP

Home » Articles by: Brad Morton

JavaScript substr() and substring() – What’s the Difference?

JavaScript substring/substr Difference

JavaScript has two similar-looking methods for extracting substrings from strings – substr() and substring(). This article explains the difference. These two functions perform almost the same function and have almost the same name, and at a glance, even seem to have the same syntax – but they’re different! Here is the syntax for each function – side by side so that you can see the difference. A Quick Reminder about Indexes An index is the integer number representing the position of an item in a series. Indexes start counting at 0 – so the … Read more