DIY 9V Battery Power Supply

9V Battery Power Supply

In this post, I’ll show a 9V battery portable power supply I made quite a few years ago by originally following this tutorial. This particular power supply uses a voltage regulator(LM317) to drop down the voltage and dissipate the energy as heat. This means it becomes inefficient at higher currents. So it is most useful to power things that don’t require a lot of power.

Useful Resources For Software Engineers

Useful Software Engineering Resources

It’s hard to remember everything you learn over the years especially if you don’t use it very often. That’s why I think it’s good to have a compilation of cheatsheets, reference books or other types of resources like blog posts/videos/PDFs. So in this post, I will “bookmark” some useful software engineering resources and cheatsheets for myself(or anyone else who stumbles upon this post).

chrome dev tools performance

Chrome Dev Tools

In this post, we’ll take a look at some of the very useful developer tools available in Google Chrome. If you press F12 Chrome Dev Tools will open up. Here you will be able to see the source files of the webpage you are on, the console with erros, warnings and messages, memory usage, networking, …

Code Snippets JS 2D Library Konva.js

Javascript 2D Library Konva.js

In this post, we’ll take a look at the Konva.js. Konva is a pretty nice 2D javascript graphics library for the browser. I discovered it when I needed a 2D library for a project at work. It supports both Vue and React frameworks. The reason a library is useful compared to just drawing objects on a canvas is that it provides you with an easy way to draw, style, find, manipulate and attach events to objects.

Code Snippets Exceptions

PHP Exceptions

In this code snippet, we’ll learn how to throw and handle an exception in PHP. Exceptions are used to indicate that an error has occurred within our code. For this demo, we’ll make a simple function that returns the sum of all the elements in a given array. But if the array is empty we’ll throw an exception. We’ll also check the data type of each element using gettype() to make sure the provided value is in fact a number, else an exception will be thrown.

PHP Code Snippets Make a PDF

PHP Making PDFs

In this code snippet, we’ll learn how to make a PDF file in PHP. We will use the FPDF library to generate a PDF. More specifically we’ll see how to create page headers/footers, add page numbers, write text, use cells, use multicell, inserting links and images.

Code Snippets Reading And Writing Excel Files

PHP Reading And Writing Excel Files

In this code snippet, we’ll learn how to read and write excel files in PHP. We will use the PHPSpreadsheet library to read/write Excel files and we’ll learn how to read cells, find a specific string in a row or column, write to cells, set cell styling and formatting(like setting the border, background color, etc) and we’ll see how to insert images.

Code Snippets Using DomDocument To Work With HTML

PHP Using DomDocument To Work With HTML

In this code snippet, we’ll see how to work with HTML using DomDocument in PHP. If you need to change HTML in code or extract some data from it(web scraping) you can use the DomDocuemnt class to help you with that. You simply create a new instance of it and load the HTML and then you can use its functions to access the DOM.

Code Snippets Global Exception Handler

PHP Global Exception Handler

In this code snippet, we’ll make a global exception handler in PHP. A global exception handler is used to catch any unhandled exception that might bubble up in your code. This way you can log the exception and let the user know there was an error instead of the program just crashing.