The Apache Software Foundation, is friggin awesome. They come up with some really great things, moreso they have an excellent list of open source projects which have really had a huge impact everywhere.  Apache Web Server is one the most widely used servers out there coughing up HTML/CSS/PHP to the world wide mass.

Windows 7 Apache Nutch Apache Tomcat

Apache Nutch is an open source web crawler, and builds on Apache Solr and Lucene technologies.

Tomcat is a Java Servlet container also an Apache project impementing Java Servlets, and JavaServer Pages.  For many large companies it’s a mission critical application.  If you don’t know what a servlet is, think of an outlet mall you shop at.  One building contains many different stores.  Tomcat, like an outlet mall, allows you to contain many different applications.

Now, the purpose of this little write up is to show you how to successfully install Apache Nutch and Tomcat on a Windows 7 machine, granted you pay attention and your current machine isn’t configured funky.

Read the rest of this entry

, , , , , , ,

CodeIgniter is an awesome PHP Web Framework with a light footprint and just easy to use.  Despite that its easy to use, we still run into problems and errors when we get deep in the trenches of testing our applications.

PhpConsole is a developer tool for Google Chrome by Barbushin Sergey which, when installed, will output PHP errors and debugging in the Chrome console, and/or by way of notification popups.  This is a pretty handy tool and its uses can certainly be applied to any PHP application your writing for the browser.  However in this instance I’m going to show you how to throw it up into CodeIgniter quite easily.

First goto https://chrome.google.com/webstore/detail/nfhmhhlpfleoednkpnnnkolmclajemef in Chrome and install PhpConsole. In the description on that page you’ll see the google code repository link for PhpConsole (and Lagger as well), click the code repo link and then download the .zip file in the downloads section.

Extract the .zip file and place PhpConsole into the root of your CodeIgniter application, right next to index.php

Next open that index.php file and at the very top add the following lines:

require_once('PhpConsole.php');
PhpConsole::start();

And there you have it, test some errors in your codeigniter application and they will show up in Chrome to help you get rid of those frustrating ones :)

Hope this helps!

, , , ,

I recently installed the WordPress plugin Jetpack, which puts together some fabulous WP plugins into a bundle. The problem I was having was that Sharedaddy, one of the available bundled plugins, was not being shown in my posts. So I started looking around in the WP plugin forums, and really didn’t find a solution. I almost felt like I had to contact ‘support’ in order to get this working because a lot of the threads posted had such replies.

Anyways, after a little fiddling around and a tip in a thread about a function, I decided to go ahead and code it into my themes functions.php file.

If this breaks your WordPress – don’t blame me, I will attempt to be as clear as possible.

First open up your themes functions.php file, and open up the file at jetpack/modules/sharedaddy/sharing-service.php

If you’re familiar with the functions.php file, you know that this file has functions and miscellaneous stuff related specifically to your theme. The sharing-service.php file has PHP classes which set up the Sharedaddy services for use.

In your functions.php file create a new function for use within the theme. You can name the function anything you want. Go ahead and use this code.

 
function show_sharing($text = '') {
 
	include(ABSPATH . 'wp-content/plugins/jetpack/modules/sharedaddy/sharing-service.php');
 
	static $shared_with_posts = array();
	global $post;
 
	$server = new Sharing_Service;
	$global = $server->get_global_options();
 
	if ( !is_feed() ) {
		if ( $global['show'] == 'posts' && ( is_single() || is_page() ) )
			$show = true;
		elseif ( $global['show'] == 'index' && ( is_home() || is_archive() || is_search() ) )
			$show = true;
		elseif ( $global['show'] == 'posts-index' && ( is_single() || is_page() || is_home() || is_search() || is_archive() ) )
			$show = true;
	}
 
	$switched_status = get_post_meta( $post->ID, 'sharing_disabled', false );
 
	if ( !empty( $switched_status ) )
	{
		$show = false;
	}
 
	// Only show once
	if ( isset( $shared_with_posts[$post->ID] ) )
		$show = false;
 
	$shared_with_posts[$post->ID] = true;
	$sharing_content = '';
 
	if($show)
	{
		$enabled = $server->get_blog_services();
 
		if ( count( $enabled['all'] ) > 0 ) {
			global $post;
 
			$dir = get_option( 'text_direction' );
 
			// Wrapper
			$sharing_content .= '<div class="snap_nopreview sharing robots-nocontent">';
			$sharing_content .= '<ul>';
 
			// Visible items
			$visible = '';
			foreach ( $enabled['visible'] AS $id => $service ) {
				// Individual HTML for sharing service
				$visible .= '<li class="share-'.$service->get_class().' share-regular">';
				$visible .= $service->get_display( $post );
				$visible .= '</li>';
			}
 
			$parts = array();
			if ( $global['sharing_label'] != '' )
				$parts[] = '<li class="sharing_label">'.$global['sharing_label'].'</li>';
 
			$parts[] = $visible;
			if ( count( $enabled['hidden'] ) > 0 )
				$parts[] = '<li class="share-custom"><a href="#" class="sharing-anchor">'._x( 'Share', 'dropdown button', 'jetpack' ).'</a></li>';
 
			if ( $dir == 'rtl' )
				$parts = array_reverse( $parts );
 
			$sharing_content .= implode( '', $parts );			
			$sharing_content .= '<li class="share-end"></li></ul>';
 
			if ( count( $enabled['hidden'] ) > 0 ) {
				$sharing_content .= '<div class="sharing-hidden"><div class="inner" style="display: none;';
 
				if ( count( $enabled['hidden'] ) == 1 )
					$sharing_content .= 'width:150px;';
 
				$sharing_content .= '">';
 
				if ( count( $enabled['hidden'] ) == 1 )
					$sharing_content .= '<ul style="background-image:none;">';
				else
					$sharing_content .= '<ul>';
 
				$count = 1;
				foreach ( $enabled['hidden'] AS $id => $service ) {
					// Individual HTML for sharing service
					$sharing_content .= '<li class="share-'.$service->get_class().'">';
					$sharing_content .= $service->get_display( $post );
					$sharing_content .= '</li>';
 
					if ( ( $count % 2 ) == 0 )
						$sharing_content .= '<li class="share-end"></li>';
 
					$count ++;
				}
 
				// End of wrapper
				$sharing_content .= '<li class="share-end"></li></ul></div></div>';
			}
 
			$sharing_content .= '<div class="sharing-clear"></div></div>';
		}
 
	}
 
	echo $sharing_content;
}

Ok. Basically this function recreates another function found in the sharing-service.php file called sharing_display(), except that it is trimmed up for our purposes…I repeat – dirty hacks. :p

Now that you have a new function in your theme that rebuilds the Sharedaddy services bar, you can add it to any part of your theme with

echo show_sharing();

Celebrate by sharing this link with others

, , , , , , , ,

I read a lot of RSS feeds, I traverse the web soaking in a lot of information on a daily basis. If your like me, and a lot of people out there, you just don’t have the time to go to every website to read your favorite news and articles; we aggregate.

Let me give you a look at a really awesome, open source, web-based application I just found. Installed. Fell in love with.

The application is called Managing News and it’s developed by a company named Phase 2 Technology. You may have heard of their open source web-based collaboration platform “Open Atrium” but that’s for another post (shit…am I name dropping or what?). Anyways aside from the other cool projects Phase 2 develops, Managing News is pretty spectacular. Not to mention the default Jack Theme is a brilliant UI, and easily customizable.

Managing News has a lot of great features which make it just a wonderful piece of software for personal and even public use. You can add as many feeds as you like to the system which combines all of them for a global latest news channel, or you can view each individual one, create new channels based on tags you define for feeds, pinpoint on a map where the article is referring to, and so much more…it’s just…awesome.

“So whats the catch,” you ask?

There is no catch.  Like I previously stated the system is Open Source and released under a GNU GPL.  The core of the system is built on Drupal, another really excellent and popular framework for building web applications.

You can obtain the latest release of ManagingNews from the official website.  I would even suggest checking out Phase 2 Technologies as well.

Goto ManagingNews     Goto Phase 2

, , , ,

This little snippet was originally used in a small CodeIgniter library I wrote which would fetch my most recent tweet, the source of the tweet, and the amount of followers I currently had.

//Change the value of $user to your Twitter username
$user = 'yourusername';  
 
$ch = curl_init('http://twitter.com/users/show.xml?screen_name='.$user);  
 
//We are going to open/create a local file to write our fetched data to it.
$fp = fopen('/'.$user.'.xml', "w");
//Set cURL options for our file, not to write the XML header 
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, false);  
 
//Excecute cURL
curl_exec($ch);  
 
//Lets close up these functions
curl_close($ch);
fclose($fp);  
 
//This is the location of the user.xml file
$file = '/'.$user.'.xml';  
 
//Here we call PHP's SimpleXMLElement Class to handle the .xml file
 $xml = new SimpleXMLElement($file, NULL, TRUE);  
 
//Simply declare that $path is an array that contains all of  node
$path = $xml-&gt;xpath('/user');  
 
//create an array of the elements in the xml file we want to display
foreach ($path as $node)
{
           $status = array('time' =&gt; $node-&gt;status-&gt;created_at,
                         'text' =&gt; $node-&gt;status-&gt;text,
                         'source' =&gt; $node-&gt;status-&gt;source,
                         'followers' =&gt; $node-&gt;followers_count);
}  
 
print_r($status);
, , , ,

Recently I’ve been taking a look at returning coordinate (x, y) values in jQuery. At first I was a bit confused between the differences between two functions in jQuery. These two functions are offset() and position(). Given the jQuery documentation, the descriptions for these two functions could probably use a little more descriptive reference. Though I may just be playing that card in part of my own misunderstanding at first, though it wouldn’t be the first time the jQuery docs have confused me.

Respectively lets look at the descriptions for these two functions.

Read the rest of this entry

, , ,