Darcy Clarke's Blog http://www.clarke78.com/ Web design, development, and interaction design thoughts and tutorials en-ca You can reach darcy [at] clarke78 [dot] com Copyright %2010 What's new with Darcy http://www.clarke78.com/index.php/view/post/34 http://www.clarke78.com/index.php/view/post/34

Over the past few months I've worked with my good friend Nick La on a new service that goes by the name "Themify" (http://themify.me). After spending many late nights and weekends working away we finally launched earlier this month. Over the past few weeks we've been met with great feedback from the Wordpress and the creative community at large.

That said, this company has begun to spread wings. Starting September 6th Themify will require my full attention and devotion. This change will not only allow me to focus on a product driven side of work I've never experienced but also free up some time to give back to the design and development communities. I plan to contribute more frequently to open source projects and blog about my experiences as a developer / designer / and user, gained over the past 7+ years. 

Of course, with every new venture comes some sort of change, good or bad. Knowing this, I'm sad to say that, to pursue this opportunity fully, I must leave my role as Lead Developer at Jet Cooper. 

I can't express, in words, how much it has meant to me to be able to work alongside my best friends for over a year now. There is no better company I could have ever worked for and I have cherished every moment dearly.

I'm extremely proud of the work we've produced and the great clients we've had the chance to work with (many of which I now consider good friends). I would not be who I am and where I am today without the challenges and opportunities that each project has given me. From the bottom of my heart thank you for pushing me and feeding my drive to be better at what I do everyday.

Working together, the team and I have already begun taking steps to make this a smooth transition. Jet Cooper will always be a place I call home and that will never change. I look at this not as an end but a beginning. Friendships and experiences will never be forgotten or replaced.

]]>
The last Wordpress theme you'll ever need http://www.clarke78.com/index.php/view/post/33 http://www.clarke78.com/index.php/view/post/33 Themify WordPress Themes

I've been working with my buddy Nick La for more then a few months on our new project Themify.me. We've worked for countless hours to try and hone and define some key aspects to Wordpress theme's other people in this realm have forgotten.

Over the next few weeks I'll be posting video tutorials on how to use the theme's to their maximum potential. With a little bit of learning you will eventually see the potential of the framework that is packaged within every theme.

We're hoping to eventually build an online store to let others build themes, skins (for themes), and plugins specific to the Themify framework. This will hopefully open up avenues for developers and designers to make some cash while contributing to, what we think is, a fantastic platform.

]]>
php simple twitter class http://www.clarke78.com/index.php/view/post/32 http://www.clarke78.com/index.php/view/post/32 Awhile ago I wrote a light Twitter PHP class that could grab and update your status. I also threw in two methods for Tiny and Tr.im url shortners. Check it out.

// DEFINE TWITTER CLASS AND UPDATE STATUS WITH OUTPUT RETURNING HTTP CODE
$run = new twitterClass();
echo $run->UpdateStatus('my message');

// TWITTER CLASS
class twitterClass { 

	// SET GLOBAL VARIABLES 
    private $twitter_username = ''; 
    private $twitter_password = ''; 
	private $trim_username = '';
	private $trim_password = '';
    
	// CHECK WHERE THE REQUESTING URL IS COMING FROM
	public function CheckReferer(){
		$url = parse_url($_SERVER["HTTP_REFERER"]);
		return $url;
	}
	
	// GRAB THE RETURNED CODE FROM HTTP REQUEST AND REFERENCE DEFINITION
	public function HTTP_Code($code){
		switch ($code) {
			case 200:
				$return = "Updated!";
				break;
			case 301:
				$return = "Moved Permanetly!";
				break;
			case 302:
				$return = "Found!";
				break;
			case 304:
				$return = "Not Modified!";
				break;
			case 307:
				$return = "Temporary Redirect!";
				break;
			case 400:
				$return = "Bad Request!";
				break;
			case 401:
				$return = "Unauthorized!";
				break;
			case 403:
				$return = "Forbidden!";
				break;
			case 404:
				$return = "Not Found!";
				break;
			case 410:
				$return = "Gone!";
				break;
			case 500:
				$return = "Internal Server Error!";
				break;
			case 403:
				$return = "Not Implemented!";
				break;
			default:
				$return = "Bad Return Code! Code: $http_code_return. ";
			}
			
			return $return;
	}
	
	// REPLACE WITH Tiny URL
	public function TinyURL($url){
		$return = file_get_contents("http://tinyurl.com/api-create.php?url=".$url); 
		return $return; 
	}
	
	// REPLACE WITH Tr.im URL
	public function TrimURL($url){
		$xml = file_get_contents("http://api.tr.im/api/trim_url.xml?url=".$url."&newtrim=yes&username=".$this->trim_username."&password=".$this->trim_password); 
		$return =  new SimpleXMLElement($xml);
        return $return->url;
	}
	
	// GET LAST STATUS UPDATE
    public function LatestStatus() { 
        $buffer = file_get_contents("http://twitter.com/statuses/user_timeline/".$this->twitter_username.".xml?count=1"); 
        $xml = new SimpleXMLElement($buffer); 
        $return = $xml->status; 
        return $return->text; 
    } 
	
	// UPDATE STATUS
    public function UpdateStatus($message){ 
    	
		$message = urlencode($message);
		$username = $this->twitter_username;
		$password = $this->twitter_password;
	
		$curl = curl_init(); 
		
		curl_setopt($curl, CURLOPT_URL, "http://twitter.com/statuses/update.xml?status=$message");
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
		curl_setopt($curl, CURLOPT_POST, 1); 
		curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); 
		
		$exec = curl_exec($curl); 
		$http_code_return = curl_getinfo($curl, CURLINFO_HTTP_CODE); 
		$this->HTTP_Code($http_code_return);
		
		curl_close($curl); 
		
		return  $return; 
             
    }
} 
]]>
php simplest, cookie based, login script http://www.clarke78.com/index.php/view/post/31 http://www.clarke78.com/index.php/view/post/31 I wrote an extremely quick and simple PHP based login script a few years back for some peers. It uses some basic methodology and cookies to authenticate. You can easily modify this script to use sessions, protect against cookie tampering, or add a salt to the encrypted password.

The "Read Me.txt" should give you any direction you may need. 

You can download the scripts here.

Simple Login.zip includes:

  • authenticate.php
  • backend.php
  • database.php
  • index.php
  • logout.php
  • process.php
  • Read Me.txt
  • SQL.txt
]]>
php recursive find and replace http://www.clarke78.com/index.php/view/post/30 http://www.clarke78.com/index.php/view/post/30 If you've ever worked with the str_replace() function in PHP you may or may not have come across the issue with it not recursively looping through arrays. 

I recently came across this issue when having to deal with a multi-dimensional array that I needed to have scrubbed for certain values. Here's the quick code snippet I wrote to take care of this little task.

// Recursive String Replace - recursive_array_replace(mixed, mixed, array); 
function recursive_array_replace($find, $replace, $array){ 
	
	if (!is_array($array)) {
		return str_replace($find, $replace, $array);
	}
	
	$newArray = array();
	
	foreach ($array as $key => $value) {
		$newArray[$key] = recursive_array_replace($value);
	}
	
	return $newArray;
}
]]>
structuring your web apps files/folders http://www.clarke78.com/index.php/view/post/29 http://www.clarke78.com/index.php/view/post/29 I'm always looking for the best way to structure my folders and files when building client apps so that I can easily navigate and update important features down the road. I've finally settled on a very streamlined approach to structuring when developing web sites / apps.

Firstly, I break down the primary folders into: app, resources, and system.

The app folder contains the views, controllers, and models folders that have custom subsequent files for the application.

The resources folder will contain the images, CSS, Javascript, Flash, and any other resource folders with subsequent files.

Finally, the system folder contains any folders and files that run your core framework or system.

This sorting of folders/files is especially useful when you have to upgrade your system or framework to the latest version or install the latest patch.

]]>
jquery collapsing nav http://www.clarke78.com/index.php/view/post/28 http://www.clarke78.com/index.php/view/post/28 I've used this same technique a few times across a couple projects now. jQuery collapsable navs are all around the internet so if you've already seen 3-4+ you're probably not going to encounter anything new here.

The basic HTML:


The CSS

	ul li ul
{	display: none; }

The Javascript:

$(document).ready(function(){

$('ul li a').click(function() {
	
	var checkElement = $(this).next();
	
	if(checkElement.is(':visible')) {
		checkElement.slideUp('normal');
		return false;
	}
	
	if(!checkElement.is(':visible')) {
		$('ul li ul:visible').slideUp('normal');
		checkElement.slideDown('normal');
		return false;
	}
});

});

Give it a try. Pretty straight forward stuff but here's a demo anyways: Demo

]]>
quick jquery/ajax tip http://www.clarke78.com/index.php/view/post/27 http://www.clarke78.com/index.php/view/post/27 Pulling your JSON data from a file is a pretty straight forward process. Usually most of my AJAX requests are run through jQuery's shorthand $.get() or $.post() functions. What I've come across, many times, is that these functions allow me to write my requests fast enough that I end up forgetting to declare my expected return datatype.

With the $.ajax() function you define your data type wherever you want, before or after your callback functions. With the shorthand versions you are stuck declaring your data type last.

$.get('json.php', function(data){
	$(data).each(function(key, value){
    	// Use the JSON Data
    }, 'json');
});

Of course if you get into a bad habit of not declaring your datatypes you're leaving yourself open to the infamous "undefined" error. This is basically because jQuery doesn't know how to parse the data.

This has saved me a bit of time in, and squashed some headaches, the past.

]]>
angry developers? for good reason? http://www.clarke78.com/index.php/view/post/26 http://www.clarke78.com/index.php/view/post/26 Just recently my friend Brian posted "A Problem Attitude" over on his site http://briangilham.com. I completely agree with him that, some, developers can have a bad attitude when dealt with. I have been one of them at times. Although, I think I have always had good reason to complain about the cards I've been dealt.

My biggest complaint, and what I find myself bitching about the most, is when I'm passed documents that are missing critical information or thought. 

Agencies all have different processes but there are some fundamental things that are always the same and usually have the same problems.

A very basic overview of the process would be:

Information Architecture Phase -> Design Phase -> Development Phase

(This is a linear example. A modular approach would be iterative and some other Agencies may have a completely different approach. Although this is the most widely used from my experiences.)

Lack of detail, planning, and content within the initial IA phase leads to gaps in the overall direction and documentation. This results in errors and confusion down the line. Rest assured, I have never seen one set of IA documents that have been too detailed or thought out. There is always something missing and it's usually user interaction.

Dealing with mostly flat images and, many times, with no animation or interaction experience, Designers leave out critical information when passing on their designs. Materials and direction are often asked for down the line, by the Developer, when they should have been provided initially.

Stepping in at the last part of the process is the Developer who is left with a host of issues to deal with. These, of course, are brought on due to the lack of understanding and thorough planning from the previous phases.

This leads to aggravation and disdain by the Developer who has to ask questions and make decisions that they shouldn't have to.

The easiest way to avoid this scenario, and keep your Developer happy, is to ensure the Development process is literally just execution. Do as little back peddling as possible by "measuring twice cutting once".

If you can provide a streamlined process with thorough understanding, planning, and collaboration through out then I assure you that won't find your Developer up in arms. If so, then you've got a bad employee not Developer.

**

]]>
first! http://www.clarke78.com/index.php/view/post/23 http://www.clarke78.com/index.php/view/post/23 So I've been working on a new look and feel for my blog/site for awhile now. I've actually designed and re-designed multiple versions of the site. I finally stuck with something that was pretty simple and straightforward.

I actually have a ton of flexibility in the way I've developed the HTML+CSS of the blog. Similar to Jason Santa Maria's website (http://jasonsantamaria.com/) I can develop a custom CSS file to go along with each individual post and make each one stand out similar to a magazine article.

I'll give a good example of this with my next post. I'm hoping to build a larger library of tutorials and helpful web based info for anyone interested. 

As a side note, if anyones wondering if this blogs built on Wordpress, you'd have guessed wrong. It's a completely custom blog script I built off Codeigniter (http://www.codeigniter.com) and may release for free after I've made it bug free.

Enjoy and stay tuned!

Subscribe to my RSS feed here: http://clarke78.com/index.php/view/rss

]]>
Introducing Sprouter http://www.clarke78.com/index.php/view/post/16 http://www.clarke78.com/index.php/view/post/16 The team at RedWire had a few tricks up their sleeves when celebrating another successful "Wired Wednesday" this past month. Unveiling their new brand Sprouter and introducing, along with it, a brand new tool for entrepreneurs and small businesses to connect and communicate. 

Sprouter is cashing in on some key aspects from the popular site Twitter that have worked so well for that San Fran based company.

Micro blogging has been Twitters curb appeal for awhile now and Sprouter capitalizes on this, aiming its content for a niche market. More professional conversations, questions, and answers are being posted daily at Sprouter.

Sprouter Home Page

Looking more in depth, the site allows for content creation on a larger scale. Hashtag ownership by topic or event creation allows people to drive conversations and to associate all instances of that hashtag used in seeds/updates with that original content.

Hashtag association allows for anyone to easily follow a hastag they have created and drive the conversation adding and editing the original content.

Along with some other mainstream features, Sprouter tries to spin the "What are you doing?" tag line from Twitter updates and use something geared towards their start-up based market. "What are you working on?" is a great question to help drive a more professional and business like conversation. It comes across as the perfect starting point to jump into a conversation about your latest project or venture.

Sprouter is a must use whether your a small business owner, entrepreneur, or freelancer.. 

Go check it out at: http://www.sprouter.com/ where the site is currently in a closed beta. You can email invite@sprouter.com to get a free invitational code for the beta and start building your relationships.

]]>
You Say What? http://www.clarke78.com/index.php/view/post/17 http://www.clarke78.com/index.php/view/post/17 Say Yeah! is a UX development company that aims to build great websites and web development tools for their clients and internally. Having been able to work with the guys at Say Yeah! for a brief stint, I was able to see how much they enjoy their work day in and day out.

Just recently, the team released their first major update to their Toronto Events Calendar. The Calendar provides a wide variety of events and has something for everyone in the GTA. The site allows for anyone to register and create events, with the major update now bringing specific iCal support and attendance tracking.

The design and functionality has been greatly improved to accommodate for these cool new features, and is a welcome change.

Give the new features a run around yourself and I'm sure you'll appreciate the fluid UI, vibrant colors, and a wealth of community support all wrapped in one. This is the number one stop for information on Community events.

Check it out here: http://www.yousayyeah.com/calendar

Say Yeah! Calendar Update

]]>
Qik Video Streaming http://www.clarke78.com/index.php/view/post/3 http://www.clarke78.com/index.php/view/post/3 Sometimes something comes into your life and you just have to spread the word. Climb on top of the highest roof top and scream "EVERYONE LISTEN UP" and profess your love. I've found that something.

Well not exactly, in fact, if this service died tomorrow I'd still live, and breathe, and do lots of other fun stuff. BUT, www.qik.com is a cool service to stream / record your stream all through your cell phone (smartphone).

The app was first shown to me by my friend Brian over at www.briangilham.com (and best known for his twitter app www.ttcupdates.com *plug* lol). Anyways, I've come to love the idea of streaming live content through my iPhone and I can't wait to give it a full go when my new Twitter experiment get's into full swing.

If you want to see my live feed + past videos, my profile can be found here: www.qik.com/xclarke78x

]]>
Twitter Update 1 http://www.clarke78.com/index.php/view/post/10 http://www.clarke78.com/index.php/view/post/10 So I've finally got some time to blog about how my little twitter experiment is going. If you don't know already I've taken upon myself to try to maximize whatever twitter has to offer for one month. After which I will make some graphs and pie charts to show you how much of my time was wasted and how much value came from it.

NOW, on to the good stuff. I have 24 followers as of this post (please go add me if you havent already) and I think I started 3-4 different conversations through twitter (this may also be because I'd rather not use msn anymore).

Anyways, as of right now I'm following around 75 people as well. I'm going to shoot for that number to be closer to around 1,000 and similar to my followers. But who knows. This experiment is strictly viral and I really am trying to use this tool legitimetly and without bias. So I'm having to really force myself to "tweet" on a regular basis.(hopefully relevant and fun things you want to read).

Update #1 does come about 5 days into my experiment so hopefully by next week I'll be able to show more progress and maybe even get a job through twitter (since I need one).

Follow me :) @xclarke78x

]]>
Website Launch http://www.clarke78.com/index.php/view/post/4 http://www.clarke78.com/index.php/view/post/4 Anyone that knows me well knows that I've been under a lot of pressure / stress the past month-ish to get a bunch of projects done. Well, in 3 days I have been able to get a brand new website up. That's right, I said THREE DAYS!

So if things are a tiny bit buggy or there are links that haven't got their back-end coded, please... oh please bare with me. Literally in another 2 weeks I'll be able to have content flowing out and comments available for everyone to use.

P.S. I'm not using some Wordpress throw together. This site is running off of my own dirty PHP+xHTML+CSS+Javascript code. Hopefully you like it! And I'll have a release of the blogging scripts out once I've finished them myself ;)

]]>
Twitter Experiment http://www.clarke78.com/index.php/view/post/2 http://www.clarke78.com/index.php/view/post/2 Ok, I'll admit it. What some may already know, and many others have already heard spew out of my mouth... I HATE TWITTER!

It's sad to say but I am that guy sitting in a corner grumbling while everyone is happy as a clam with this new social networking tool. I can't get past the sad fact that it's a bloated status update community.

I don't need to know what's going on in your life 24/7. It's disgusting to know that there is databases filled with things like "Just got back from the store" and "Can't wait for *place event here*. Sad.

So enough ranting!!! I apologize to everyone I just offended but it had to be said for you to understand what I'm about to endeavor.

For the next 30 days, I will be maximizing every aspect of Twitter and "tweeting" every moment to try and create contacts and use it however many ways it can be used, while still blogging and vlogging about it. Un-biased, open minded, of course. So bare with me as I try to wrap my head around this phenomena and at the end of it all, give you proof that I'm a grumpy old man, or that I'm extremely wise for my age.

]]>