and like us on FB In aggregating content to BeliefMedia as we retire old websites, we’ve had to put serious thought into how certain functionality was handled and maintained. One of the most significant features we were never happy with in the past was how downloads were handled. While there’s a plethora of WordPress plugins available that’ll handle file downloads in different ways, there weren’t any that managed downloads the way we wanted them to. Back when we didn’t haveRead More
Posts by Martin:
and like us on FB The CMYK color model is a subtractive color model used in color press printing. CMYK refers to the four inks used in some color printing: cyan, magenta, yellow, and key (black). In additive color models such as RGB (used in computer monitors, for example), white is the “additive” combination of all primary colored lights, while black is the absence of light. In the CMYK model, it is the opposite: inked (white) paper absorbs or reflectsRead More
Finding the root domain name (or a top level domain, TLD) from a URL is challenging. Literature on the web generally leans towards a library that’ll find the root domain by way of comparing the URL against all approved top level domains … but this method introduces a degree of complexity that we wanted to avoid. The following function is one that we use to find a domain name root. It isn’t perfect, but it’s close.
and like us on FB The large number of string, random, and hashing functions make it easy to generate a random string with PHP. This article, partially migrated from Internoetics, will look at just a couple ways of achieving a random string from a pool of characters, with of a defined length. Generally speaking, increasing the length of a string and character count makes the string (or password) more secure. beliefmedia_random_string() The first example takes a user-defined string of permittedRead More
and like us on FB The CIE XYZ color model (created in 1931) is a ‘device-independent’ colour space in which each primary colour (X,Y,Z) is always constant, unlike RGB model where color variances occur with every individual device that applies the model (monitors, scanners, cameras, etc.). The CIE XYZ color space encompasses all color sensations that an average person can experience. As such, the model serves as a standard reference against which many other color spaces are defined. The PHPRead More
and like us on FB I went to a small Google developer day a few years back where the focus was clear: mobile design. Head designers from the Sydney office all presented their case for mobile optimized websites before responsive design became the accepted norm. They were pushing for a m.domain site designed exclusively around mobile content. While Google developers too much away, they made it clear that there were (expected and fairly obvious) search that would be updated toRead More
and like us on FB The RGB model of visualising color can be problematic on the web because of the nature in which the values are mixed. Not unlike mixing paints from individual tins, we would have to alter all the quantity of all paints to achieve our desired result. For example, if we have an orange with RGB values of R217 G118 B33 and want to reduce its colourfulness by half to a less saturated orange, we would needRead More
On a member-based site we operate we put a limit on the size of a directory before additional credit is required. The following function will recursively look through an entire directory and return a filesize. While the value returned is in bytes, you can alter it into a human readable string by using the first function from this article (“Return a Readable Filesize with PHP”).
If you find yourself with the need to re-index an array so the first element has a key of 1 (rather than 0), the following function may come in useful. The function certainly isn’t required… it’s just that we were repeatedly applying the code in a project, so it made sense.
and like us on FB If you searched this website for “Jennifer L.awrence” (prior to this post), the search would have redirected you to the only page on this site that contains that text (“”). It’s a fairly specific search term and, given that there’s only one result, it’s pretty clear what the user is looking for. In such instances, what’s the point of generating a “list” of search results? The following code will detect a single search result andRead More