Monthly Archive: June 2014

Script: Preprocess PHP

PHP doesn’t come with conditional compiliation or any preprocessor tools, but using a generic preprocessor can make life much easier. Conditional compilation is just that — blocks of code can be set to only compile and run if a certain condition is met. Many compiled programming langauges …

Continue reading »

Permanent link to this article: http://permafrostcodingstudio.com/articles/script-preprocess-php/

Syntax Highlighting In Posts

Curious how I syntax highlight source code for posts? pygmentize is a python utility that supports many languages, comes with a bunch of different styles, and can output the highlighted text in a variety of formats (like html/css, ANSI colors, etc.). After you’ve installed pygmentize, you …

Continue reading »

Permanent link to this article: http://permafrostcodingstudio.com/articles/syntax-highlighting-in-posts/

Script: Indent Lines From Stdin

In many of my shell scripts, I call other shell scripts to accompish various tasks. Sometimes the output from these sub-script calls is useful, but I like to differentiate between the output from the sub-script and the main script. Enter indent-stdin: A basic …

Continue reading »

Permanent link to this article: http://permafrostcodingstudio.com/articles/script-indent-lines-from-stdin/

Script: Automatic PHP Manual Updater

I always have the PHP chm manual open when coding, and it’s updated frequently. Instead of having to manually download a new copy every time it’s updated, I have a script that runs every night at 3 AM to …

Continue reading »

Permanent link to this article: http://permafrostcodingstudio.com/articles/script-automatic-php-manual-updater/

Favorite Script: newscript

`newscript` is a bash shell script that I use on a daily basis. Its purpose is simple: it creates a new file with a specified name, adds a hashbang line for the proper interpreter, and chmods +x. newscript makes creating new shell scripts a breeze.

Usage: …

Continue reading »

Permanent link to this article: http://permafrostcodingstudio.com/articles/coding/favorite-script-newscript/

Older posts «