I needed some PHP code to randomly generate me a hex value for use as a color in a webpage. Here’s what I came up with (WARNING: Some colors are UGLY!)
function random_hex() { $color = ''; for ($c = 0; $c < 6; $c++) { $i = rand(0, 15); switch ($i) { case 10 : $i = 'A'; break; case 11 : $i = 'B'; break; case 12 : $i = 'C'; break; case 13 : $i = 'D'; break; case 14 : $i = 'E'; break; case 15 : $i = 'F'; break; default : $i = $i; break; } $color .= $i; } $color = '#' . $color; return $color; }
Comments Disabled
Well, I’ve had enough of dealing with blog-comment-spam for now, so I’ve decided to disable comments until I can come up with a satisfactory solution. I have 123 blog posts that I’m going to have go through by hand – AGAIN – to remove spam from. I don’t have time for this, but I refuse to be a PageRank monkey for these losers by leaving their links up and accessible on my site.
It really saddens me to have to do this, and I think it reflects very poorly on the current state of the internet. Damn the idiots who are blog-comment-spamming, damn them to hell and back. People like you are making the internet a worse place to be. We’d all be much happier if you would go away and die in a hole somewhere.