From the archive! Create Checksums Using The Luhn Algorithm In PHP

The Luhn algorithm was created by Hans Peter Luhn and is a way of creating a simple checksum for a number.

This algorithm, also known as the mod 10 algorithm, is used in a wide variety of applications but is commonly associated with credit card numbers.

https://www.hashbangcode.com/article/create-checksums-using-luhn-algorithm-php
#php #luhnAlgorithm #hashbangcode

Create Checksums Using The Luhn Algorithm In PHP

The Luhn algorithm was created by Hans Peter Luhn and is a way of creating a simple checksum for a number. This algorithm, also known as the mod 10 algorithm, is used in a wide variety of applications but is commonly associated with credit card numbers. If you look at the numbers on the front of your credit card the last digit on the right is the checksum. An algorithm is done on the other numbers and if the checksum is the same then the number is considered valid.

#! code
I had some issues with debugging reverse proxy headers this week. After not finding a module that allows me to do what I needed, I created this little module
https://www.drupal.org/project/debug_headers
It allows you to drop a block on a page and view the headers available.
Currently as a dev release, but if it looks ok I'll release it as a full module.
#drupal #hashbangcode

New! Keychron Q3 Pro SE Wireless Mechanical Keyboard: A Review

Whilst looking at the Keychron site I found the Q3 Pro, which is a TKL keyboard that has a wheel and 4 macro keys.

It has been over a year since I bought this board and I have spent many hours typing on it I thought a review was about due for it.

https://www.hashbangcode.com/article/keychron-q3-pro-se-wireless-mechanical-keyboard-review
#review #MechanicalkKeyboard #keychron #hashbangcode

Keychron Q3 Pro SE Wireless Mechanical Keyboard: A Review

When I bought my Keychron K2 in 2020 I was happy with it for a couple of years before I wondered what other options were available. During that time Keychron lunched quite a few different keyboards, including updates to the K2. The K2 I have is version 1, and whilst it is a good keyboard I was looking for a keyboard with more features and hot swappable switches so I could experiment a little.

#! code

From the archive! Drupal 9: Entity Bundle Classes

Drupal 9.3.0 came with a new feature called entity bundle classes. This allows more control of entity bundles within Drupal and provides a number of benefits.

In this article we look at creating entity bundle classes, why they are useful, if you should be using them in your Drupal projects.

https://www.hashbangcode.com/article/drupal-9-entity-bundle-classes
#drupal #drupal10 #drupal11 #drupalDevelopment #hashbangcode

Drupal 9: Entity Bundle Classes

Drupal 9.3.0 came with a new feature called entity bundle classes. This allows more control of entity bundles within Drupal and provides a number of benefits over the previous mechanism of using hooks to control everything.

#! code

New! A Look At Flood Fill Algorithms In PHP

In this article we will look at two flood fill algorithms, in PHP, and then extend them to look at using a threshold to control how much of the image is filled in.

https://www.hashbangcode.com/article/look-flood-fill-algorithms-php
#php #images #hashbangcode

A Look At Flood Fill Algorithms In PHP

If you have ever used a paint program then you might have used a flood fill algorithm. This is a mechanism by which an area of an image can be filled with a different colour and is normally depicted by a pain can pouring paint.The flood fill algorithms used to fill in spaces in images are well known, and have been used for decades in all kinds of systems, not just graphics processing programs.

#! code

From the archive! Creating A Game With PHP Part 4: Side Scrolling Shooter

This article looks at creating an ASCII based game played on the command line, in PHP.

A side scrolling shooter, if you didn't already know, moves a scene from right to left across the screen with enemies moving with the scene towards the player's ship, which is on the left hand side of the scene.

https://www.hashbangcode.com/article/creating-game-php-part-4-side-scrolling-shooter

#php #programming #games #gameProgramming #hashbangcode

Creating A Game With PHP Part 4: Side Scrolling Shooter

As another step up from the game of snake I created in my last post I decided to try my hand at creating a side scrolling shooter. Just like my other posts, this is an ASCII based game played on the command line. A side scrolling shooter, if you didn't already know, moves a scene from right to left across the screen with enemies moving with the scene towards the player's ship, which is on the left hand side of the scene. The player can fire bullets towards the enemies so remove them from the scene.

#! code

New! Kiwi Ears Ardor Bluetooth Headphones: A Review

The Kiwi Ears Ardor are a set of over ears headphones that have Bluetooth, AUX cable and USB-C connectivity. They also include active noise cancelling (ANC) and can be used to make and receive calls when attached to a phone.

In this article we will look at the headphones, what their features are, how they operate, and how they sound.

https://www.hashbangcode.com/article/kiwi-ears-ardor-bluetooth-headphones-review
#tech #review #hashbangcode

Kiwi Ears Ardor Bluetooth Headphones: A Review

The Kiwi Ears Ardor are a set of over ears headphones that have Bluetooth, AUX cable and USB-C connectivity. They also include active noise cancelling (ANC) and can be used to make and receive calls when attached to a phone.In this article we will look at the headphones, what their features are, how they operate, and how they sound.

#! code

New! A Look At Benford's Law

Benford's Law is an interesting heuristic in data analysis. It states that in any large collection of numbers that are created naturally, you should expect to see numbers starting with the number 1 about 30% of the time.

In this article we will look at how to calculate Benford's Law and then applying the law against a series of data sets to see if we can spot any issues.

https://www.hashbangcode.com/article/look-benfords-law
#benfordsLaw #php #hashbangcode

A Look At Benfords Law

Benfords Law is an interesting heuristic in data analysis. It states that in any large collection of numbers that are created naturally, you should expect to see numbers starting with the number 1 about 30% of the time. The frequency distribution of numbers states that 2 should appear about 17% of the time, down to 9 being seen just 5% of the time.

#! code

From the archive: Drupal 10: Adding Custom Permissions To Groups

The Group module in Drupal is a powerful way of collecting together users and content under a single entity.

This article looks at all of the ways in which you can add permissions to Groups. Plus, the content has been verified as correct by the Group module author :)

https://www.hashbangcode.com/article/drupal-10-adding-custom-permissions-groups
#drupal #drupalDevelopment #hashbangcode

Drupal 10: Adding Custom Permissions To Groups

The Group module in Drupal is a powerful way of collecting together users and content under a single entity. These arbitrary collections of entities in a Drupal site can be used for editor teams within your site or company subscriptions where users can manage themselves, or anything that requires groups of users to be created.

#! code

New! Protecting A Page From Being Directly Accessed With PHP

In this article we will look at how to protect a page from being directly accessed without using a user authentication system.

I will address any pros and cons of each method so if you are looking for a way to protect a page then one of these might be useful to you.

https://www.hashbangcode.com/article/protecting-page-being-directly-accessed-php

#php #hashbangcode

Protecting A Page From Being Directly Accessed With PHP

I was thinking recently about the number of ways in which I could restrict access to a page using PHP.The obvious option is to create a user authentication system, but in some situations that is overkill for what is required. If you just want to prevent users from going directly to a certain page then there are a few options open to you.

#! code