An old PHP script to list the most recently updated files within a web site using their ‘last modified’ time stamps.
Category: Programming
Python: Statistics Calculators
Some statistics calculators written for Python 2.x (the str.format() method requires Python >= 2.6). Of course you could just use the numpy or statistics libraries, but where’s the fun in that? All solutions verified where possible by Wolfram Alpha or else by EasyCalculation.com.
Python: XML-RPC Requests
Tinkering with Python xmlrpclib, in this case for updating a WordPress blog from the command line. Using Python 2.7.6 here. xmlrpclib is included with Python 2.7, but if you need it, install with Pip.
WordPress Plugin Development Tutorial
This article is intended to serve as a simple WordPress plugin development tutorial. For the purpose of demonstration we’ll create a plugin that removes comment spam. For this to work, you have to be running some sort of anti-spam system like Akismet that marks spam comments as such when they’re submitted. Comments are written into […]
C#.NET: Doc/Docx to Simple HTML Converter
I have this problem: mo matter what my official job or title, people keep sending me Word documents that they want posted online to match the web site styling. Yes, you can use Word to convert documents to HTML, but Microsoft’s version of “HTML” resembles the Rohonc Codex — little has changed since the days […]
C#.NET: Countdown Timer
This is a simple Windows Forms countdown timer I created a few years back. I’d start something in the kitchen, get distracted on the computer, and then burn whatever I was cooking, so I built this to warn myself. The program takes user input into a masked textbox, uses the Systems.Windows.Forms.Timer class to count down […]
Stupid SQL Tricks
Joins This intends to provide a brief summary of JOIN operations. I’m attempting to follow standard SQL here where possible, thus avoiding, say, Oracle terminology like ANTIJOIN and SEMIJOIN. All SQL databases that I’ve encountered perform LEFT/RIGHT/INNER JOIN as expected, but others will show some variation. When in doubt, refer to your documentation. The generic […]
Drupal: Programmatically Create a Block
So you want to add a block to your module in Drupal 7. First, define its internal name and human-readable title (for the Blocks UI) with hook_block_info(): Then, give it the permissions needed to view it, a title (to appear for your site visitors), and some content with hook_block_view(): If you want to give the […]
Customize the Drupal Search Form
Here’s an easy one: you want to customize the Drupal search form provided by the Search module in your Drupal 7 site. Fortunately, Drupal provides an easy way to do this, via hook_form_alter(). Put something like this in your theme’s template.php: This defines the appearance of the search block form, which you can then place […]
Drupal Module Development Tutorial
On my Drupal 7 site here, I wanted to create a method of automatically injecting my Google Ad banners on all content pages before the Disqus comments thread. You could do this manually, say by adding a text field to your basic page content_type with a default value of all the Google Ads JavaScript, but […]