Friday Fork: Colorful Language

/Friday Fork /Code /Javascript /PHP

I’m currently working on little project which will require unique colors for various points of data. Since the data points can be anything from “bran flakes” to “Yahtzee” I decided that it would be better to have the words themselves act as the generators of the color which would represent them. I figured that in ASCII all letters are just numbers so I could come up with a system which would conver the words into HSL CSS values. I wrote through my ideas quickly in PHP so I could easily script their output for testing. I then translated the function to Javascript, which I have published as a Gist called “Colorful Language”.

reading time 5:05 / read >>>

Friday Fork: Formatting Elapsed Time in PHP

/Friday Fork /Code /PHP

I have been working on a project which got me running PHP in the command line. I wanted to know how long the script had been running since it would be running for hours at a time. As I tweaked the code and ran mini-tests I wanted to know how much my changes were improving the time it took to process.

reading time 3:53 / read >>>

Code: PHP Argument Styles

/Code /PHP

I recently got fed up with excessively long argument lists on some of my PHP methods and decided to try passing arrays instead of ordered lists of variables and values. I wanted to know for sure, though, how it would impact my script’s performance so I arranged a test.

reading time 2:44 / read >>>