<?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>bojanpejic.com &#187; Tips and Tricks</title>
	<atom:link href="http://bojanpejic.com/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://bojanpejic.com</link>
	<description>Scrap Book About Web – Programming – Development – Places, and more 8-)</description>
	<lastBuildDate>Sun, 16 May 2010 14:37:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Clone VirtualBox vdi Image</title>
		<link>http://bojanpejic.com/clone-virtualbox-vdi-image/</link>
		<comments>http://bojanpejic.com/clone-virtualbox-vdi-image/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 06:50:41 +0000</pubDate>
		<dc:creator>bojan</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[clone]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://bojanpejic.com/?p=68</guid>
		<description><![CDATA[Few words about VirtualBox VirtualBox is an open source virtualization product for home and enterprise use. It gives you the power to work on some other OS than you&#8217;re running (Windows, Linux, Macintosh and Solaris as hosts), and it supports a great number of guest operating systems. How to clone? Let&#8217;s suppose you setup you...]]></description>
			<content:encoded><![CDATA[<h3><img class="alignright size-full wp-image-73" title="virtualbox clone vdi image" src="http://bojanpejic.com/wp-content/uploads/2009/11/virtualbox.png" alt="virtualbox clone vdi image" width="200" height="200" />Few words about VirtualBox</h3>
<p><a href="http://www.virtualbox.org/" target="_blank">VirtualBox</a> is an open source virtualization product for home and enterprise use. It gives you the power to work on some other OS than you&#8217;re running (Windows, Linux, Macintosh and Solaris as hosts), and it supports a great number of guest operating systems.</p>
<h3>How to clone?</h3>
<p>Let&#8217;s suppose you setup you guest OS, installed some applications, made updates, and now you wish to backup it if something goes wrong. The easiest solution will be to find directory where is your vdi file and copy it somewhere as backup, but that isn&#8217;t the good solution. You have to clone it!</p>
<p>There are few solutions how to do it, this one is when the host is a Windows OS. Run command prompt and enter the directory where is your VirtualBox applications installed (usually program files) and than execute a command.</p>
<pre class="brush: plain;">C:\Program Files\Sun\VirtualBox&gt;VBoxManager.exe clonevdi "source" "destination"</pre>
<p>Suppose your vdi image is located on D: drive under directory VBox and named ubuntu910 and you want to make a vdi image clone named bckup_ubuntu910 on D: drive. That will look like this:</p>
<pre class="brush: plain;">C:\Program Files\Sun\VirtualBox&gt;VBoxManager.exe clonevdi "d:/VBox/ubuntu910.vdi" "d:/bckup_ubuntu910.vdi"</pre>
<p>After execution of command you&#8217;ll see a percentage number of cloning status in command prompt, when it reaches 100% your vdi clone is ready. Clone has got new UUID (Universal Unique Identifier), so there will be no conflict if you decide to use both (original and the cloned one).</p>
]]></content:encoded>
			<wfw:commentRss>http://bojanpejic.com/clone-virtualbox-vdi-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Multiple Firefox Profiles</title>
		<link>http://bojanpejic.com/using-multiple-firefox-profiles/</link>
		<comments>http://bojanpejic.com/using-multiple-firefox-profiles/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:26:01 +0000</pubDate>
		<dc:creator>bojan</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://bojanpejic.com/?p=57</guid>
		<description><![CDATA[Time since I discovered this little trick, I use it always. I like that I can have two Firefox profiles run at the same time, but they are totally different. They have separate directories created for profiles and as that they can have totally different extensions installed than each other. So, I have created recently...]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-59" title="firefox" src="http://bojanpejic.com/wp-content/uploads/2009/11/firefox.jpg" alt="firefox" width="160" height="160" />Time since I discovered this little trick, I use it always. I like that I can have two Firefox profiles run at the same time, but they are totally different. They have separate directories created for profiles and as that they can have totally different extensions installed than each other. So, I have created recently one more profile for web developing, which contains all the extensions I need for it like Firebug, Web developer toolbar, some validators, etc. Now I have the default profile which is used for surfing over Internet with own extensions, browsing history, bookmarks, and web development profile with it own extensions.</p>
<h3>How to create Firefox profile?</h3>
<p>I won&#8217;t make a full descriptions of steps how to do it, I rather redirect you to some places where I also got knowledge about this. Just shortly, after you created your new Firefox profile you can make a shortcut for it, only what you have to do is to add few parameters in the target field. In my case it looked like the following line.</p>
<pre class="brush: plain;">&quot;C:\Program Files\Mozilla Firefox\firefox.exe&quot; -P WebDev -no-remote</pre>
<p>As you can suppose from the line above, my new profile name was &#8220;WebDev&#8221; before which is a parameter &#8220;-P&#8221; which means profile, so we call profile named &#8220;WebDev&#8221; and &#8220;-no-remote&#8221; parameter is which enables to run multiple profiles!</p>
<p>For further read I suggest to visit following links which explains in more details how goes the profile creation part and all together.</p>
<ul>
<li>Born Geek &#8211; <a href="http://www.borngeek.com/firefox/profile-tutorial/" target="_blank">Firefox Tutorial</a></li>
<li>How to Geek &#8211; <a href="http://www.howtogeek.com/howto/internet/firefox/use-multiple-firefox-profiles-at-the-same-time/" target="_blank">Use Multiple Firefox Profiles at the Same Time</a></li>
</ul>
<p>I think this is very handy, how about you?</p>
]]></content:encoded>
			<wfw:commentRss>http://bojanpejic.com/using-multiple-firefox-profiles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Compress JavaScript Code</title>
		<link>http://bojanpejic.com/how-to-compress-javascript-code/</link>
		<comments>http://bojanpejic.com/how-to-compress-javascript-code/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 10:26:17 +0000</pubDate>
		<dc:creator>bojan</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[compressor]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jsmin]]></category>
		<category><![CDATA[minify]]></category>
		<category><![CDATA[packer]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://bojanpejic.com/?p=34</guid>
		<description><![CDATA[In past few months and recently I did some JavaScript coding. The whole source code wasn&#8217;t so big, around 15kB, but it may be growing more, and there are also other JavaScript files which are included in the page and maybe I merge them. To reduce amount of data and in hope to little speed...]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-36 alignright" style="border: 1px solid black;" title="how to compress javascript" src="http://bojanpejic.com/wp-content/uploads/2009/10/howto_compress_javascript.png" alt="how to compress javascript" width="300" height="200" />In past few months and recently I did some JavaScript coding. The whole source code wasn&#8217;t so big, around 15kB, but it may be growing more, and there are also other JavaScript files which are included in the page and maybe I merge them. To reduce amount of data and in hope to little speed up loading of the page I was looking for some options to compress (minify) the source code.</p>
<h3>What means to minify JavaScript?</h3>
<p>One more term which is used for reducing the size of code is <em>minification</em> or <em>minify</em>.</p>
<blockquote><p><strong>Minification</strong> (very often just <strong>minify</strong>, and sometimes also <strong>minimisation</strong> or <strong>minimization</strong>), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code, without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments and sometimes block delimiters; which are used to add readability to the code, but are not required for it to execute. &#8211; wikipedia.org</p></blockquote>
<h3>Why to compress/minify?</h3>
<p>In putting to a simple way the whole quote above, compress (minify) the code to load it faster! Beside that you&#8217;ll reduce the bandwidth consumption of website, and number of HTTP requests if you combine several JavaScript files in one.</p>
<h3>Tools for compress/minify</h3>
<p>Searching over Internet I found several tools which are commonly used for compressing JavaScript code, these tools for compress are:</p>
<ul>
<li><a title="jsmin" href="http://crockford.com/javascript/jsmin" target="_blank">JSMin</a> by Douglas Crockford</li>
<li><a title="Dojo compressor" href="http://dojotoolkit.org/docs/shrinksafe" target="_blank">Dojo compressor</a></li>
<li><a title="JavaScript packer" href="http://dean.edwards.name/packer/" target="_blank">Packer</a> by Dean Edwards</li>
<li><a title="YUI compressor" href="http://developer.yahoo.com/yui/compressor/" target="_blank">YUI compressor</a></li>
<li><a href="http://code.google.com/p/minify/" target="_blank">Google minify</a></li>
</ul>
<p>JSMin &#8211; is a filter which removes comments and unnecessary   whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads.   It also encourages a more expressive programming style because it eliminates   the download cost of clean, literate self-documentation.</p>
<p>Dojo compressor &#8211; in the design of the the Dojo compressor,  instead of brittle regular expressions, the Dojo compressor is based on Rhino, a JavaScript engine from the Mozilla project.</p>
<p>Packer v3.0 &#8211; some features of it are respect Microsoft conditional terms, new option to shrink variable and argument identifiers, removed the special chars feature  (except the <code>;;;</code> feature which people seem to like) etc.</p>
<p>Google minify -  is a PHP5 app that helps you follow several of Yahoo!&#8217;s <a rel="nofollow" href="http://developer.yahoo.com/performance/index.html#rules">Rules for High Performance Web Sites</a>. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.</p>
<p style="text-align: left;">YUI compressor &#8211; The YUI Compressor is a JavaScript compressor which, in addition to removing comments and white-spaces, obfuscates local variables using the smallest possible variable name. This obfuscation is safe, even when using constructs such as &#8216;eval&#8217; or &#8216;with&#8217; (although the compression is not optimal is those cases) Compared to JSMin, the average savings is around 20%.</p>
<p style="text-align: left;">Note: it&#8217;s possible to make gzip compression of code, which are supported natively by modern web browsers, and also shrink previously minified JavaScript file.</p>
<h3>Which one to use?</h3>
<p>Well that&#8217;s a personal decision, I read some posts and articles over Internet and most of them suggests YUI compressor, but it don&#8217;t means that you have too.</p>
<p>On web page called <a href="http://compressorrater.thruhere.net/" target="_blank">JavaScript CompressorRater</a> you can found details and analyzes how successful are different compression tools in action. Compression is done on popular JavaScript libraries. I recommend to visit it, at least you can get some view on their success in action.</p>
<h3>Online compress tools</h3>
<p>Here are some online compress tools for beginning:</p>
<ul>
<li><a href="http://www.minifyjs.com/" target="_blank">http://www.minifyjs.com</a></li>
<li><a href="http://jscompress.com/" target="_blank">http://jscompress.com</a></li>
<li><a href="http://javascriptcompressor.com/" target="_blank">http://javascriptcompressor.com</a></li>
</ul>
<p>In some of next posts I&#8217;ll try to explain how to make it done on your computer, not with an online compress tool. Happy compressing!</p>
]]></content:encoded>
			<wfw:commentRss>http://bojanpejic.com/how-to-compress-javascript-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
