ldir 1.8.1 released!


Written by

While using ldir within a different project, I found a couple of bugs releated to how it retrieves its own URL/URI so I figured out a better way of retrieving this information and updated ldir available to everyone else.

I have decided to deprecate the $GET parameter when using the function as it should now detect $_GET variables automatically and utilise them although this maybe still be a little buggy but the ultimate aim is for it to figure out the $_GET variables itself.

In the time it took me to write a post for version 1.8.0 I improved some of the $_GET parameter code so I incemented the version number to 1.8.1 and you can grab the latest version of ldir on its page as always

Changelog:

  • Automatic $_GET variable detection
  • Improved $_GET variable detection
  • Microtime generation time in HTML comments
  • Improved SELF detection for the link URL

Android DHCP IP Release


Written by

Just because I spent about 2 hours looking for this info…

A rooted android device with busybox can easily release the DHCP allocated IP with the following commands

su
dhcpcd -k wlan0
dhcpcd -n wlan0

turn wifi on and off and now you should have a new DHCP IP rather than a renewed IP.

Sublime 2 GPLv3 Snippet and SMARTY


Written by

I’ve stared using the very powerful yet minimalistic text editor Sublime Text 2, one of the great features is the ability to customise it to your personal needs.

GPL v3

Some of the code I write I license under the GPL v3 but because the code is only a small function, I don’t want to include the full GPL in the source so I use the minimal header. To ease my life and make it quicker to include this minimal header in my code I have written a small snippet for Sublime to insert the minimal GPL.

Just type

**GPL**

and press tab to comete the code. This will then move the cursor to the program and description part where you pop the name and a brief description. You’ll probably want to change the copyright name to your own in the snippet.

To install the snippet just download it, open Sublime click Preferences > Browse Packages and put it in the user folder in there, then restart Sublime.

 

Sublime SMARTY Support

It took me a while to find the forum post so I’m reposting the info here, sublime actually supports smarty semi-natively but its not turned on, so here’s how to turn it back on…

  1. Open file “Packages\HTML\HTML.tmLanguage”, if you search for string “<!–” you will notice that (currently) there is two references to “Smarty language” commented. Un-comment these.
  2. Download the SMARTY.PLIST and rename it “Smarty.tmLanguage” and place in the user folder (Packages\User\).
  3. Some colour schemes may not support it properly but idlefingers does so very well too.

Update to GimpFM


Written by

I have just updated one of the many sites I help maintain, GimpFM, to bring it into a more modern web standard.

For those interested, I have used bootstrap as the base framework. I typically use Zurb’s Foundation but after a bit of hype I thought I’d give bootstrap a go.

Overall I’m pleased with the outcome of the site and bootstrap has potential and is very well featured but foundation seems faster and easier to make the site responsive during development.

Anyway, that’s all for now.

X-Cart Cleanup and XCache


Written by

So my work’s site has X-Cache setup and so any changes made to the site is usually cached in two places, X-Cache and with X-Carts Smarty.

So to make things simple, I’ve integrated the cleanup of the cache’s into the default x-cart cleanup page.

So just edit cleanup.php to include these lines:

 

// Remove XCache cache if it's installed.
if (function_exists("xcache_clear_cache")) {
	echo "XCache ";
	$i=0;
	while ( $i < xcache_count(0)) {
		@xcache_clear_cache(0, $i);
		echo "php#".$i.", ";
		$i++;
	}
	$i=0;
	while ( $i < xcache_count(1)) {
		@xcache_clear_cache(1, $i);#
		echo "var#".$i.", ";
		$i++;
	}
	echo " Removed.";
}