<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Daniel Baldwin &#187; programming</title>
	<atom:link href="http://www.danielcbaldwin.com/tag/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.danielcbaldwin.com</link>
	<description>Web Developer and Technology Enthusiast</description>
	<lastBuildDate>Thu, 27 May 2010 00:03:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Website as a jQuery Plugin</title>
		<link>http://www.danielcbaldwin.com/technology/websie-as-a-jquery-plugin</link>
		<comments>http://www.danielcbaldwin.com/technology/websie-as-a-jquery-plugin#comments</comments>
		<pubDate>Thu, 02 Jul 2009 05:54:29 +0000</pubDate>
		<dc:creator>dbald</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery plugins]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.stilito.com/?p=120</guid>
		<description><![CDATA[I recently had to build a site that ran mainly off of jQuery and I had the whole thing working from one script.js file that just had a lot of functions in it with some global functions defined at the top. The more I looked at this mess of a file the more I felt [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to build a site that ran mainly off of jQuery and I had the whole thing working from one script.js file that just had a lot of functions in it with some global functions defined at the top. The more I looked at this mess of a file the more I felt disappointed with myself that I had allowed myself to code so horribly.</p>
<p>So I went on a mission to turn the entire site into an object. I tried many different ways, including Javascript&#8217;s built in prototyping, but nothing seemed to turn out as nicely as I would have hoped. So I had the crazy idea of turning the entire site&#8217;s code into a jQuery plugin. Well it has worked out very well and even though it is a it of a wierd thing to do I have taken to making site that use alot of javascript into jQuery plugins.</p>
<p>The problem for me is that what was outlined on the jQuery documentation wasn&#8217;t all that helpful and I found that using existing plugins to figure out how the plugins were being built was alot more helpful but also confusing as there seems to be a nearly unlimited amount of ways to make a plugin. So after searching around for a while and a bunch of trial and error this is what I ended up with:</p>
<pre class="brush: jscript;">/*** Sample jQuery Plugin*/
 (function($) {
    function Sample() {};

    $.extend(Sample.prototype, {
        settings: {
            base_url: ''
        },

        init: function() {
            this.sampleFunction();
        },

        sampleFunction: function() {
            /* Sample Function Code */
        }
    });
    //Plugin End
    /**	*	Event Handlers	*/
    $(document).ready(function() {
        if ($.sample == undefined) {
            $.sample = new Sample();
        }
        $.sample.init();
    });

})(jQuery);</pre>
<p>I find that I like to call the plugin after the site, e.g. jquery.danielbaldwin.js, and I name the function accordingly. I have found that having all the javascript for a site in one object has helped me to build sites that are more complex, can have persistent variables easily, I can set settings that can be changed just by changing a 1 to a 0, and I feel like my code within the object becomes so much cleaner and more legible.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.danielcbaldwin.com%2Ftechnology%2Fwebsie-as-a-jquery-plugin&amp;linkname=Website%20as%20a%20jQuery%20Plugin"><img src="http://www.danielcbaldwin.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.danielcbaldwin.com/technology/websie-as-a-jquery-plugin/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Replacing fonts? Try replacing sIFR.</title>
		<link>http://www.danielcbaldwin.com/technology/replacing-fonts-try-replacing-sifr</link>
		<comments>http://www.danielcbaldwin.com/technology/replacing-fonts-try-replacing-sifr#comments</comments>
		<pubDate>Fri, 26 Jun 2009 04:58:35 +0000</pubDate>
		<dc:creator>dbald</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cufon]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sifr]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.stilito.com/?p=79</guid>
		<description><![CDATA[sIFR has always been really impressive with how well it works and how it can make websites look good and unique. However, I constantly dread implementing sIFR on a site as the setup always seems to be such a process that results in some issue that I have to spend extra time working out. For [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mikeindustries.com/blog/sifr/" target="_blank"><img class="size-medium wp-image-98 alignright" title="Cufon Diagram" src="http://www.stilito.com/wp-content/uploads/2009/06/Generation-205x300.png" alt="Generation" width="144" height="210" />sIFR</a> has always been really impressive with how well it works and how it can make websites look good and unique. However, I constantly dread implementing <a href="http://www.mikeindustries.com/blog/sifr/" target="_blank">sIFR</a> on a site as the setup always seems to be such a process that results in some issue that I have to spend extra time working out.  For a long time I just assumed that this was the kind of hardship that I would have to deal with in order to appease all the designers out there since fir me the only other option was image replacement which is not an option for me because of server load and  portability. Now, though, I am looking forward to not going through all the hassle because I have been recently introduced to a new option, <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a>, that promises to be much easier.  The things right off the bat that I really like about <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a> are that it doesn&#8217;t require any additional plugins such as flash, it works in all the major browsers, and it seems to render almost immediately. Getting <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a> running is also really easy and painless, the hardest part is that you have to go to their generator page, http://cufon.shoqolate.com/generate/, to generate some javascript that creates the font for you. Then you set up the page like this: <br class="clear" /></p>
<pre class="brush: xml;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;

	&lt;title&gt;Cufon Demo&lt;/title&gt;
	&lt;script src=&quot;http://cufon.shoqolate.com/js/cufon-yui.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
	&lt;script src=&quot;Swiss_721_700.font.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
		Cufon.replace(&quot;h1&quot;);
	&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;h1&gt;Replaced Text&lt;/h1&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p><img class="alignnone size-full wp-image-97" title="Cufon Demo" src="http://www.stilito.com/wp-content/uploads/2009/06/Cufon-Demo.jpg" alt="Cufon Demo" width="286" height="205" />So doing the replacement really takes almost no code and almost no time to setup. There are 2 other parts of <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a> that have me impressed and happy. The first is that the selectors for the replace are very basic by default but lets you do advanced selectors with the help of a javascript framework like jQuery or Prototype and you dont have to do anything extra other than just have the framework there. I think this is cool because for me most of the time I am using jQuery or Prototype on my projects so they are already there and then I know that Cufon&#8217;s code isnt bloated with repeat functionality.  The second feature that I am excited for is <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon&#8217;s</a> ability to reload it&#8217;s replacements on the page. This is helpful when content changes on the page without a page reload like with ajax. In sIFR you would have to re-call your whole replacement statement and it would look something like this:</p>
<pre class="brush: jscript;">sIFR.replace(newsgothicbd, {
	selector: '.demo_top',
	wmode: 'transparent',
	css: '.sIFR-root { background-color: #F9F9F9; color: #417596; text-transform: uppercase;} a { color: #417596; text-decoration: none; } a:hover { color: #417596; text-decoration: none;}'
});</pre>
<p>however with <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a> you can just do this:</p>
<pre class="brush: jscript;">Cufon.refresh();</pre>
<p>So I think it is pretty obvious that I am excited for this find and I am really excited to integrate the use of <a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a> into my daily web development. I really thing that this will make the sites I work on look better, have a smaller footprint, and load much faster than with <a href="http://www.mikeindustries.com/blog/sifr/" target="_blank">sIFR</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.danielcbaldwin.com%2Ftechnology%2Freplacing-fonts-try-replacing-sifr&amp;linkname=Replacing%20fonts%3F%20Try%20replacing%20sIFR."><img src="http://www.danielcbaldwin.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.danielcbaldwin.com/technology/replacing-fonts-try-replacing-sifr/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A New Found Friend</title>
		<link>http://www.danielcbaldwin.com/life/a-new-found-friend</link>
		<comments>http://www.danielcbaldwin.com/life/a-new-found-friend#comments</comments>
		<pubDate>Wed, 10 Dec 2008 17:05:15 +0000</pubDate>
		<dc:creator>dbald</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[evernote]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.stilito.com/?p=61</guid>
		<description><![CDATA[Organization in life seems to always be an issue. There are always so many things to remember and do. I started using Evernote when it first came out but now that it is so cross platform, has an iPhone app, and has a better rounded feature set. I have been able to see the benefit [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_64" class="wp-caption alignright" style="width: 238px"><a href="http://www.evernote.com/"><img class="size-medium wp-image-64" title="Evernote" src="http://www.stilito.com/wp-content/uploads/2008/12/logo.gif" alt="Evernote" width="228" height="60" /></a><p class="wp-caption-text">Evernote</p></div>
<p>Organization in life seems to always be an issue. There are always so many things to remember and do. I started using <a href="http://www.evernote.com/">Evernote</a> when it first came out but now that it is so cross platform, has an iPhone app, and has a better rounded feature set. I have been able to see the benefit of using Evernote.</p>
<p>I am currently using Evernote to store receipt, manage task lists using the <a href="http://www.hogbaysoftware.com/products/taskpaper">TaskPaper</a> format, and recently I realized that I could use Evernote to store code snippets and have access to them wherever I go.</p>
<p>This is a great product and I hope that we will be seeing more great features coming out of the Evernote team soon. For instance blogging right from Evernote wouldnt be a bad idea.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.danielcbaldwin.com%2Flife%2Fa-new-found-friend&amp;linkname=A%20New%20Found%20Friend"><img src="http://www.danielcbaldwin.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.danielcbaldwin.com/life/a-new-found-friend/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
