Category: Uncategorized

CakePHP controller for Imagemagick

URL Example: This would load the source image (example.jpg), apply Imagick::thumbnailImage(100, 100, 1) to the file, then save it in a special cache directory. You may also define your own methods within the controller. Before images are loaded, _preimage_{method} functions are checked for existence. this allows you to change image paths and do any [...]

CakePHP whmcs module – interacting with whmcs api via Cake

<?php App::import('Core', array('HttpSocket')); class WhmcsComponent extends Object { /** * WHMCS component * * Rudimentary wrapper for curl-based API connection to WHMCS. * * PHP version 5 * * Licensed under The MIT License * * @lastmodified Date: March 24, 2009 * @license The MIT License */ /** * URL of WHMCS api. * [...]

Recursively find PHP files with trailing spaces after the PHP close tag

# ruby -e ‘Dir.glob( “**/*.php” ) { |file| puts file if /?>s{2,}Z/m) }’

Easily upgrade Ubuntu from commandline using update-manager-core

Used to upgrade from Hardy Heron to Intrepid Ibex. Super easy. # sudo apt-get install update-manager-core # sudo vi /etc/update-manager/release-upgrades change Prompt=lts to Prompt=normal # sudo apt-get update # sudo do-release-upgrade Checking for a new ubuntu release Done Upgrade tool signature Done Upgrade tool Done downloading extracting ‘intrepid.tar.gz’ authenticate ‘intrepid.tar.gz’ against ‘intrepid.tar.gz.gpg’ … Do you [...]