PHP: How to use password_hash and password_verify

In this article I will describe how to use two PHP functions, password_hash and password_verify, that are important for website login pages that use a user name and password. 1. password_hash() Here is what the PHP documentation says about password_hash: password_hash() creates a new password hash using a strong one-way hashing algorithm. password_hash() is compatible … Continue reading PHP: How to use password_hash and password_verify

HTML & CSS: How to use column-count to automatically divide text into columns

Let’s say I have a project where I want to print all numbers from 1 to 100 in a web page. For this example, I am using the the ZeroCool problem where I print “Zero” for all multiples of 3, “Cool” for all multiples of 5, and “ZeroCool” for all numbers that are a multiple … Continue reading HTML & CSS: How to use column-count to automatically divide text into columns

HTML & CSS: How to control uneven columns with Flexbox align-self

Building on the Flexbox foundation described in this previous article: HTML & CSS: How to understand the basics of Flexbox for responsive web design I am now going to describe how to control columns that may have varying amounts of data in them. Flexbox has an attribute for the child element called “align-self” which can … Continue reading HTML & CSS: How to control uneven columns with Flexbox align-self

HTML & CSS: How to understand the basics of Flexbox for responsive web design

The CSS3 Flexbox Grid system is based on the idea of a parent/child container relationship. The parent, if we call it “row” needs to have “display: flex;”. For example: /* Parent */ .row { display: flex; } The child, if we give it a class name of “col”, should have “flex: 1;”. The 1 here … Continue reading HTML & CSS: How to understand the basics of Flexbox for responsive web design

Handlebars: How to use templates

Handlebars supports multiple templates in the same Single Page Application. To use templates with Handlebars, you must define a template id in the opening Handlebars script tag. For example, in this case the name of the template is “verse-set-grid”: <script id=”verse-set-grid” type=”text/x-handlebars-template”> The pattern for a template is: <!– 1. Opening script tag with the … Continue reading Handlebars: How to use templates

Handlebars: How to iterate through an array of objects

When using the Handlebars.js templating system, a common need is to be able to iterate through an array of JavaScript objects in order to build an HTML list. This is useful for ‘Atomic’ web programming, where a component is defined, and you may have a dynamic number of such components in your database. For example, … Continue reading Handlebars: How to iterate through an array of objects

Python: How to play a video (with sound) in Pygame

When creating a game in Pygame, the trick to getting a video with sound to play is to place pygame.mixer.quit() right after pygame.init(). This is because pygame.mixer doesn’t play well with pygame.movie. For example: pygame.init() pygame.mixer.quit() Here is what that looks like in the context of a larger block of code: import pygame FPS = … Continue reading Python: How to play a video (with sound) in Pygame