Here is what I'm working on and thinking about in my spare time.
What I have:
-
I recently had a chance to help set up a small set of racks for my company. Here are my notes.
-
Here is a bash script that started out as a way to delete old Oracle GRID/RDBMS log files, and turned into a demonstration of bash scripting techniques.
-
I've done a personnel database that includes an object-oriented class file for automatically assembling ID badges in sheets of 12. Those sheets can then be cut apart and run through a laminator. Here is the class file and a sample of how to use it. This same project also has a shift scheduling system, and a full HR database.
-
I like the way PHP handles arrays, especially associative arrays, much better than the way Javascript does. So, I figured I would use PHP's foreach functionality to handle doing repetitive coding tasks in Javascript.
Start with a Javascript template. Note the /* phpSomething */ comments. Then, look at the code generator written in PHP.
I use a PHP foreach loop to create the strings, str_replace to insert the code into the Javascript template, and header to have the returned text interpreted as Javascript. The result is clean Javascript code. (One small difference: for the purposes of showing the generated code, here the header says I'm returning "text/plain" instead of "text/javascript".) The biggest advantage to generating Javascript like this is that I can use the template as a form validator for any number of forms just by changing a single array in the PHP code generator.
In the web page, I just need to do "<script src="jsBuilder.php"></script>" to get the generated code. I've done similar things to dynamically generate CSS blocks, and another similar technique using str_replace is most of the engine that runs my website.
Watch this space! There's more to come, including links to more of these projects.