Category Archive: Coding tips

Powershell: Get extension of a string

Easy way to get the extension of a path or filename.

Microsoft SQL SELECT INTO multiple values

Today I came across an interesting construct in Microsoft SQL whereby you are allowed to insert multiple values into a table using a single SELECT INTO statement. Naturally there are more ways of achieving the same goal (SELECT..UNION, CREATE TABLE .. INSERT INTO) but I thought it would be interesting to post this option here …

Continue reading »

Oracle SQL Developer – Get Results in Query window

If you want the Oracle SQL Developer script results to show in a query window instead of the script window, read this article!

PHP: Use from Windows command line

In today’s post I will show you how you can use the PHP scripting language on a Windows machine without requiring any installation. There are a number of advantages to this. As a first bonus, you can use existing skills you have to do certain tasks on your windows machine. Additionally, because no installation of …

Continue reading »

Javascript: Show/Hide table rows and colspan

In order to show and hide table rows using Javascript, you need to use the CSS style “table-row” instead of “block” for Chrome and Firefox.

MySQL: Getting records near a date

I recently had to write a query in PHP that returned a ranking per a specified date and time. The rankings get saved every hour, but not precisely on the hour. The user does not know when the rankings were saved precisely but wants to know what the ranking was per “yyyy-mm-dd hh:mm” or as …

Continue reading »

PHP: Switch structure to check variable

Suppose you want to use PHP check the variable $var and see if it smaller than, equal to or larger than zero. There are two ways to go about this: switch($var) { case 0: echo “Equal to zero”; break; case ($var0): echo “Larger than zero!”; break; } The issue with this code is that if …

Continue reading »

PHP: Get last iteration in a for..each loop

Find out how to check if you are currently in the first or last iteration of your foreach loop in PHP.

Enable image upload in FCKEditor

My goal is to enable image uploading in FCKEditor. I am using FCKeditor in order to allow a customer to create HTML e-mails that can be sent to their clients using PHPList (2.10.12). What I would have thought is something that should work at the click of a button took me a few hours to …

Continue reading »

Convert videos to iPod ready format

To simplify the process of converting videos to an iPod ready format, use the following script available here. This script works by running through all files in a folder. If the video has the .avi format, it will try to re-encode that video using the ffmpeg engine (included in the ZIP archive). The .bat file …

Continue reading »

Older posts «