Liquid Hacynth Volume 19

Final drum and bass mix of the year. Look for change-ups in 2010; more dubstep and house mixes as well as the continuation of the Liquid Hacynth series. 2009 (MMIX!) was a great year for drum and bass. Right-click the link below to download the .mp3 from dropbox:

Download Liquid Hacynth Volume 19

01. Minimized - Kantyze
02. The Merry Dancers - Fatal Forms
03. Mokum Circle - Desperate
04. Creme Brulee - Amp, Derrick, Tonika
05. Come Back Home - Netsky
06. First Is Forever - Operon
07. Fever Pitch - Kabuki
08. Days Of Rage - Artificial Intelligence
09. Just For A Moment - Ultima C
10. Red - XRS Land
11. Freerun - X-plorer & Dee'Pulse
12. The 215 - Ross D
13. Task Master - Furlonge
14. Spoons - ATP
15. Darling Heart - Well Being
16. Better Place [MIST Remix] - 4Hero
17. Touchin' You - Enea
18. Reflect feat. Faden Baloglu - X-Plorer & Dee'Pulse
19. Rock This Style - Kabuki, Jenna G
20. Testimony feat. Riya - Total Science, S.P.Y.
21. I Don't Smoke [Ed Solo, System Remix] - Deekline
22. Mr. Freeze - Zodiac
23. 4 Points - SpectraSoul
24. Top Shelf feat. Spikey T - Zero T, Mosus
25. Out There - Bal
26. Rise - Greg Packer, Big Bud
27. Nothing Better - Vortex Involute

December 30th, 2009 | Permalink

Simple Rounded Buttons in Opera with SVG-infused CSS

One of the important considerations of the new typeoneerror.com was that I'd not care as much cross-browser rendering issues or, more pointedly, "how things look in IE." That being said, I used many fun CSS3-style techniques such as border-radius:

-moz-border-radius:8px;
-webkit-border-radius:8px;

Safari (and Google Chrome, being both based on Webkit) and Firefox render my buttons and highlighted navigation buttons with rounded edges beautifully, and the rest of you get squares – it degrades pretty nicely. I did want to know whether Opera had any support for these "hacks." I'd heard of -opera-border-radius and -o-border-radius but they didn't work for me. The latest alpha version of Opera has full support for border-radius, but here's how you can achieve the exact same effect using simple SVG and pointing to those files in your CSS.

Our goal is to approximate the look created by our navigation button in browsers that support border-radius:

/* part of our navigation button definition **/
#nav ul li a {
    background-color:#03FFC1;
    border-radius:8px;          /* CSS3 */
    -khtml-border-radius:8px;   /* Some linux-based browsers */
    -moz-border-radius:8px;     /* Firefox > 3.1 */
    -webkit-border-radius:8px;  /* Safari */
}

Using XML-defined SVG, you can define a shape that you can use as a background image in CSS. Here, for example, is the definition of an SVG shape for the highlighted navigation button. Here's what the file I created (nav.svg) looks like:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <rect x="0" y="0" rx="8" ry="8" height="100%" width="100%" fill="#03FFC1" />
</svg>

Quite simply, this defines a rectangle that will scale (width/height 100%) to fill our background and has a corner radius (rx/ry) of 8. Now if I wanted to apply this to my nav buttons above:

/* use css "hacks" to target opera */
@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0){
    #nav ul li a {
        background:url(../img/nav.svg);
    }
}

You simply have to point the background of the element to the svg file just like you would an image. Won't be long now until all major browsers support border-radius; won't that be nice. I also looked in to getting something going for Internet Explorer and found this behavior script for IE that works really well. I'd only recommend it if you only have a few elements that need round edges. On the pages where I have a lot of buttons that have round corners, it took up to 10 seconds to process. Interesting idea though.

December 21st, 2009 | Permalink

PHPUnit Follow-up: Code Coverage with Xdebug on Mac

It took me considerable amount of time to figure out the correct file to edit in order to have Xdebug work from the command line with PHPUnit's --report flag. This flag generates HTML files that look something like the following image:

code coverage of ASRA 2.0 with Xdebug

This displays the number of lines that have been run in the process of unit testing; and in a lovely readable format (see Xdebug's normal format to see how much more useful this is). To get PHPUnit and Xdebug working, start by following the tutorial in the previous article. Then to get Xdebug running, check out this post by Felx Geisendörfer. Follow steps 1 + 2. If you are using regular-old MAMP, 3 + 4 should get you going just fine. The problem I had was I am using MAMP Pro, so I was editing my "template" .ini file thinking that was where the lines needed to go. Xdebug was loaded as a browser module, but was not loaded when I ran the coverage report in PHPUnit. So, in Pro, you have to add the config options to /Applications/MAMP/conf/php5. This is the ini file that the CLI version of PHP uses.

Here are the lines I added to get it working. Note that you may also need to disable the ZendExtensionManager and the zend_optimizer extension for it to work..in MAMP just uncheck the box. Check the compatibility section on the install page for more.

[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.3
;zend_optimizer.version=3.3.3
;zend_extension=/Applications/MAMP/bin/php5/zend/lib/ZendExtensionManager.so

[xdebug]
zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20050922/xdebug.so
xdebug.remote_enable = 1

If you completed the other article, PHPUnit should be using MAMP's php, which should now have Xdebug rocking and you can do something like:

# 'report' is the name of the folder the html will output to
$ phpunit --report report My_Test 
November 15th, 2009 | Permalink

Ignoring Files in TextMate's TODO Plugin

Lately, as I’ve been working on a huge Zend Framework library for rapid website development and content management, as well as the second version of my ASRA framework, I’ve been very into using Soryu’s TextMate TODO plugin. Trouble is, when you have the entire Zend library in your project (or any other huge library), you’re bound to have a ton of todo’s in your list that you don’t really “care” about.

Anyway, I just learned a super easy way to speed up and make things easier to maintain. Simply open the TextMate preferences menu and go to Advanced > Shell Variables. Add a new entry called TM_TODO_IGNORE and give it a value of Zend* (or even just Zend should work). The TM_TODO_IGNORE value just specifies a regular expression for files paths to ignore within your project, so basically this just ignores everything in the Zend library. Yay! Concise to-do list!

August 21st, 2009 | Permalink

Installing and Using PHPUnit with MAMP

Unit testing is becoming more and more popular in every day web development. I decided to see what all the fuss was about. So here's a quick tutorial on getting PHPUnit up and running with MAMP on OSX.

First you need to grab a PHPUnit release. You need a command line utility called pear-phpunit to run tests and also the PHP files that make up the framework. I recommend first doing an svn export somewhere to get the command line script and then doing another export to just export the framework library.

MAMP's default include path is /Applications/MAMP/bin/php5/lib/php and the Pear installation is there already so that's where you should install PHPUnit. So, let's start by grabbing the PHPUnit Framework:

$ cd /Applications/MAMP/bin/php5/lib/php
$ svn export svn://svn.phpunit.de/phpunit/phpunit/branches/release/3.3/PHPUnit
# ...
# Exported revision 4387.

You can use their Trac Browser to decide which release you want to work with. If you ever want to upgrade, you can just delete this folder and export a different release.

In the resulting folder, open PHPUnit/Util/Fileloader.php and do a find and replace for @php_bin@ with the path to your PHP command-line interpreter which for php5 in MAMP should be /Applications/MAMP/bin/php5/bin/php.

Next export or download the command line script:

svn export svn://svn.phpunit.de/phpunit/phpunit/branches/release/3.3/pear-phpunit

Open pear-phpuint and replace @php_bin@ with /Applications/MAMP/bin/php5/bin/php (same as the earlier file).

Next, copy the pear-phpunit executable to a location that exists in your unix PATH environment variable. My PATH already included a /usr/local/bin and I had installed a different version of Pear there earlier so I went ahead and moved it there (you may have to create a directory or put it in another directory in your path). At this point you should rename the file to "phpunit" as well. You can accomplish this via command line or (as I like to sometimes do) go to Finder > Go > Go To Folder... and type in /usr. This will allow you to use the OS GUI to copy the file over and rename it (providing you enter your password). Now you have to make the file executable to be able to run it:

sudo chmod +x /usr/local/bin/phpunit

So at this point you should have:

  • a) The PHPUnit framework in /Applications/MAMP/bin/php5/lib/php/PHPUnit
  • b) The phpunit executable moved, renamed and chmod'ed in /usr/local/bin/phpunit

If everything worked correctly, you should be able to type "phpunit" anywhere and see the "useage" information. I used the following link to set this up, so refer to that if you have any other troubles.

Here's my first couple tests for testing the Json export class in the in-progress Asra 2.0. Though I would not see myself doing this for "normal" websites, I can see how useful it is in application development. I already found a missing required class and a possible bug in just creating this simple test case.

<?php

/**
* test setup ~ /tests/Tests.php
*/
require_once dirname(__FILE__) . '/../../../Tests.php';

/**
* @see Asra.Export
*/
require_once 'Asra/Export/Data.php';
require_once 'Asra/Export/Format/Json.php';

/**
* @see PHPUnit_Framework
*/
require_once 'PHPUnit/Framework.php';

class Asra_Export_Format_JsonTest extends PHPUnit_Framework_TestCase
{
    /**
     * assert that export returns json and is valid json
     */
    public function testExportData()
    {
        $array = array("hello, world!", "hello, again!");
        $data = new Asra_Export_Data($array);
        $format = new Asra_Export_Format_Json($data);
        $this->assertNotNull($format->export());
        $this->assertNotNull(json_decode($format->export()));
    }

    /**
     * assert that passing a non-array to format throws an exception
     */
    public function testDataNotArray()
    {
        //$this->setExpectedException('Asra_Export_Exception');
        $data = "This is not an array!";
        try
        {
            $format = new Asra_Export_Format_Json($data);
        }
        catch (Asra_Export_Exception $e)
        {
            return;
        }
        $this->fail("An expected exception has not been raised.");
    }
}
July 20th, 2009 | Permalink
prev 1 2 3 4 5 6 7 8 9 10 next