<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:series="http://unfoldingneurons.com/" version="2.0"> <channel><title>Sniptrichint</title> <link>http://www.sniptrichint.com</link> <description>Your 5 minutes IT knowledge improver.</description> <lastBuildDate>Wed, 05 Jun 2013 14:54:53 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Sniptrichint" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="sniptrichint" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Add a vCard to your site</title><link>http://www.sniptrichint.com/web-development/add-a-vcard-to-your-site/</link> <comments>http://www.sniptrichint.com/web-development/add-a-vcard-to-your-site/#comments</comments> <pubDate>Wed, 05 Jun 2013 14:54:53 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[microformats]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=246</guid> <description><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2013/06/mf-white.png" class="attachment-medium wp-post-image" alt="mf-white" /></p>Nowadays, if you want to ease the way people add your contact info to their phones or any electronic addressbook, you must provide a vCard ! vCard is a Microformats project. To make it short, Microformats enable the tagging of a structured group of meta data for things like a visit card, a recipe, a [...]]]></description> <content:encoded><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2013/06/mf-white.png" class="attachment-medium wp-post-image" alt="mf-white" /></p><p>Nowadays, if you want to ease the way people add your contact info to their phones or any electronic addressbook, you must provide a vCard !</p><p>vCard is a <i>Microformats</i> project. To make it short, <i>Microformats</i> enable the tagging of a structured group of meta data for things like a visit card, a recipe, a product, a calendar event&#8230; and other <i>Microformats</i> projects.</p><p>A vCard file looks like this (well&#8230;a .vcf file) :</p><pre class="wp-code-highlight prettyprint">
BEGIN:VCARD
VERSION:2.1
N:Jon;Gheer,
FN:PHP Developer
ORG:Fifteenpeas IT
TITLE:Mr
PHOTO;GIF:https://www.fifteenpeas.com/
TEL;WORK;VOICE:(352)555-5555
ADR;WORK:;;15 helm Street,Eselborn,Clervaux 9706
END:VCARD
</pre><p>vCard is now in version 4.0 (I guess). The evolution is mainly adding new information or subdivide the existing one.</p><p>You can save it on your webroot folder (as a .vcf file) and put a link to it somewhere in the contact part of your site.</p><p>In your <i>.htaccess</i> file you must have the following line, for the right application to be triggered when downloading the vCard.vcf file.</p><pre class="wp-code-highlight prettyprint">AddType text/x-vcard .vcf</pre><p>Ok, but what if I want to have my address displayed on a website but also downloadable.</p><p>Then you will use the <b>hCard</b>. It is the same as the vCard but in your html.</p><p>It looks like this :</p><pre class="wp-code-highlight prettyprint">
&lt;div class=&quot;vcard&quot;&gt;
      &lt;img class=&quot;photo&quot; src=&quot;http://www.asite/aphoto.gif&quot; align=&quot;left&quot; /&gt;
      &lt;span class=&quot;fn&quot;&gt;Forrest Gump&lt;/span&gt;
&lt;span class=&quot;adr&quot;&gt;.....&lt;/span&gt;
.......
</pre><p>Of course, you will need an hcard parser to generate back a real vCard.</p><p>Now, plenty of examples and a wide explanation just <a
href="http://en.wikipedia.org/wiki/VCard" target="_top">here</a> and also <a
href="http://microformats.org/wiki/hcard-implementations" target="_top">here</a> and let&#8217;s not forget to google it.</p><p>Besides creating your own, on the fly, vCard generator, you will also find browser&#8217;s add-ons which can find Microformats within a page.</p><p>Knowing that this is heavily supported by Microsoft and Apple, and that there is a convergence with html5 semantic tags, you should get interested in Microformats.</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/web-development/add-a-vcard-to-your-site/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Change the download file name with html5</title><link>http://www.sniptrichint.com/snippets-2/change-the-download-file-name-with-html5/</link> <comments>http://www.sniptrichint.com/snippets-2/change-the-download-file-name-with-html5/#comments</comments> <pubDate>Tue, 14 May 2013 08:15:47 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Snippets]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[html5]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=509</guid> <description><![CDATA[<p><img
width="300" height="172" src="http://www.sniptrichint.com/wp-content/uploads/2013/05/snipHtml51-300x172.png" class="attachment-medium wp-post-image" alt="snipHtml5" /></p>Sometimes your web application generates, on the fly, downloadable files with really horrible file names. You can use the html5 download attribute as a remedy ! Just like this : &#60;!-- will download as &#34;expenses.pdf&#34; --&#62; &#60;a href=&#34;wtfreallybadassname9ad8f.pdf&#34; download=&#34;thefile.pdf&#34;&#62;Download&#60;/a&#62; A real time saver !!]]></description> <content:encoded><![CDATA[<p><img
width="300" height="172" src="http://www.sniptrichint.com/wp-content/uploads/2013/05/snipHtml51-300x172.png" class="attachment-medium wp-post-image" alt="snipHtml5" /></p><p>Sometimes your web application generates, on the fly, downloadable files with really horrible file names.</p><p>You can use the <strong>html5 download attribute</strong> as a remedy !</p><p>Just like this :</p><pre class="wp-code-highlight prettyprint">
&lt;!-- will download as &quot;expenses.pdf&quot; --&gt;
&lt;a href=&quot;wtfreallybadassname9ad8f.pdf&quot; download=&quot;thefile.pdf&quot;&gt;Download&lt;/a&gt;
</pre><p>A real time saver !!</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/snippets-2/change-the-download-file-name-with-html5/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Active Telephone links in webpages</title><link>http://www.sniptrichint.com/snippets-2/active-telephone-links-in-webpages/</link> <comments>http://www.sniptrichint.com/snippets-2/active-telephone-links-in-webpages/#comments</comments> <pubDate>Tue, 14 May 2013 08:14:36 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Snippets]]></category> <category><![CDATA[Web Development]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=506</guid> <description><![CDATA[<p><img
width="300" height="172" src="http://www.sniptrichint.com/wp-content/uploads/2013/05/snipHtml5-300x172.png" class="attachment-medium wp-post-image" alt="snipHtml5" /></p>If you&#8217;re a smartphone user, you might get sensible to websites making phone numbers directly usable by the phone on the webpage. it&#8217;s quite simple to code a phone sensitive link. Use this : &#60;a href=&#34;tel:1-555-555-555&#34;&#62;call me directly&#60;/a&#62; Some phones or browsers might automatically detect phone numbers but could be mistaken by strings made of [...]]]></description> <content:encoded><![CDATA[<p><img
width="300" height="172" src="http://www.sniptrichint.com/wp-content/uploads/2013/05/snipHtml5-300x172.png" class="attachment-medium wp-post-image" alt="snipHtml5" /></p><p>If you&#8217;re a smartphone user, you might get sensible to websites making phone numbers directly usable by the phone on the webpage.</p><p>it&#8217;s quite simple to code a phone sensitive link. Use this :</p><pre class="wp-code-highlight prettyprint">
&lt;a href=&quot;tel:1-555-555-555&quot;&gt;call me directly&lt;/a&gt;
</pre><p>Some phones or browsers might automatically detect phone numbers but could be mistaken by strings made of number which is not a phone number.</p><p>Then use this in conjunction with previous code to have full control on this behaviour in your web page.</p><pre class="wp-code-highlight prettyprint">     &lt;!-- Turn off telephone number detection. --&gt;
    &lt;meta name = &quot;format-detection&quot; content = &quot;telephone=no&quot;&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/snippets-2/active-telephone-links-in-webpages/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Yii extensions</title><link>http://www.sniptrichint.com/yii/yii-extensions/</link> <comments>http://www.sniptrichint.com/yii/yii-extensions/#comments</comments> <pubDate>Mon, 13 May 2013 11:11:53 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Yii Framework]]></category> <category><![CDATA[Yii]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=384</guid> <description><![CDATA[<p><img
width="200" height="200" src="http://www.sniptrichint.com/wp-content/uploads/2012/10/yii.jpg" class="attachment-medium wp-post-image" alt="yii" /></p>Ok, now you have an application running with Yii framework ! You can now benefit from the large amount of extensions provided by the Yii community. But what&#8217;s an extension ? Extending Yii There are many ways to extend Yii : modules, components, helpers&#8230;.but we are going to focus on one. yes, one step at [...]]]></description> <content:encoded><![CDATA[<p><img
width="200" height="200" src="http://www.sniptrichint.com/wp-content/uploads/2012/10/yii.jpg" class="attachment-medium wp-post-image" alt="yii" /></p><p>Ok, now you have an application running with Yii framework ! You can now benefit from the large amount of extensions provided by the Yii community. But what&#8217;s an extension ?</p><h3>Extending Yii</h3><p>There are many ways to extend Yii : modules, components, helpers&#8230;.but we are going to focus on one. yes, one step at a time please !</p><p>And to better understand it, just go to the Yii Framework website and download this extension.</p><p><a
target="blank" href="http://www.yiiframework.com/extension/another-scrolltop/" title="scrolltop"><br
/> Another Scrolltop</a></p><p>It&#8217;s a little scroll to top using jquery. Il will appear on the bottom right of your browser just to get, beautifully and smoothly, to the top.</p><p>We are going to use that feature in our main layout so the whole site would benefit from it.</p><p>Just unzip the archive in the protected/extensions folder. The result will be <em>protected/extensions/scrolltop</em></p><p>You now just have to add the code to your layout main.php page.</p><p>copy this before the ending html tag.</p><pre class="wp-code-highlight prettyprint">
$this-&gt;widget('ext.scrolltop.ScrollTop', array(
    //Default values
    'fadeTransitionStart'=&gt;10,
    'fadeTransitionEnd'=&gt;200,
    'speed' =&gt; 'slow'
));
</pre><p>Now check the result in your browser.</p><p>Done !</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/yii/yii-extensions/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <series:name><![CDATA[Beginning with Yii]]></series:name> </item> <item><title>Querying the WordPress Database</title><link>http://www.sniptrichint.com/tip-of-the-day/querying-the-wordpress-database/</link> <comments>http://www.sniptrichint.com/tip-of-the-day/querying-the-wordpress-database/#comments</comments> <pubDate>Mon, 13 May 2013 09:55:51 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Tip of the day]]></category> <category><![CDATA[Wordpress]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=438</guid> <description><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/wordpress-logo-300x300.png" class="attachment-medium wp-post-image" alt="wordpress-logo" /></p>Let&#8217;s imagine here that we&#8217;ve built a custom table inside your Worpress database, and that ou don&#8217;t want to use widgets nore plugins to access it. Well, you can use a template to do it ! Get the WP connection This is a sample snippet to use inside your template : &#60;?php global $wpdb; // [...]]]></description> <content:encoded><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/wordpress-logo-300x300.png" class="attachment-medium wp-post-image" alt="wordpress-logo" /></p><p>Let&#8217;s imagine here that we&#8217;ve built a custom table inside your Worpress database, and that ou don&#8217;t want to use widgets nore plugins to access it.</p><p>Well, you can use a template to do it !</p><h2>Get the WP connection</h2><p>This is a sample snippet to use inside your template :</p><pre class="wp-code-highlight prettyprint">
&lt;?php
global $wpdb; // Very very important !
$results = $wpdb-&gt;get_results(&quot;select * from your custom_table&quot;);
// and now output your result
foreach($results as $item)
{
  echo $item-&gt;any_field;
}
?&gt;
</pre><p>What is important here it the $wpdb global variable. It is an object created by the WordPress framework which gives you access to the database connection and a series of methods to work on tables.</p><p>I leave the details up to you.</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/tip-of-the-day/querying-the-wordpress-database/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Custom theme Widget Zones</title><link>http://www.sniptrichint.com/wordpress-2/custom-theme-widget-zones/</link> <comments>http://www.sniptrichint.com/wordpress-2/custom-theme-widget-zones/#comments</comments> <pubDate>Mon, 13 May 2013 09:44:36 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Wordpress]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=496</guid> <description><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/wordpress-logo-300x300.png" class="attachment-medium wp-post-image" alt="wordpress-logo" /></p>We assume here that you are building your first WordPress theme and that you want to include some Widgets area. The maind advantage is that you can easily change the appearance of your site by playing with widgets and widgets areas. The principle is quite simple. We declare the widget areas and then we init [...]]]></description> <content:encoded><![CDATA[<p><img
width="300" height="300" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/wordpress-logo-300x300.png" class="attachment-medium wp-post-image" alt="wordpress-logo" /></p><p>We assume here that you are building your first WordPress theme and that you want to include some Widgets area. The maind advantage is that you can easily change the appearance of your site by playing with widgets and widgets areas.</p><p>The principle is quite simple.</p><ol><li>We declare the widget areas and then we init them.</li><li>We create the place holders in your theme.</li><li> In your appearance admin panel you drag and drop the widgets.</li></ol><p>And you&#8217;re done.</p><h2>Declare the widgets areas in your theme</h2><p>This is done through the functions.php file (a mandatory file if you create a WP theme.</p><p>I&#8217;m going to declare here 4 areas that I will use in the footer of my website. I will then use <strong>footer.php</strong> to display theme. (It is of good practice to split your theme into (<em>header.php, index.php and footer.php</em>).</p><p>For convenience I will create a function that creates the areas and then I will register it to the WP core engine.</p><pre class="wp-code-highlight prettyprint">
function my_widget_areas() {
 //call to register footer sidebar widgets
    register_sidebar( array(
            'id'			=&gt; 'my_footer1',
            'name' 			=&gt;  __('First 1/4 footer column', 'mythemeentityname'),
            'description' =&gt; __(' footer\'s left side widget area (1/4 column)', 'mythemeentityname'),
            'before_widget' =&gt; '&lt;br /&gt;
&lt;div class=&quot;small-3 columns&quot; id=&quot;%1$s&quot; class=&quot;fwidget %2$s&quot;&gt;',
            'after_widget' 	=&gt; '&lt;/div&gt;
&lt;p&gt;',
            'before_title' 	=&gt; '&lt;br /&gt;
&lt;h3 class=&quot;widget-title&quot;&gt;',
            'after_title' 	=&gt; '&lt;/h3&gt;
&lt;p&gt;',
    )); //end footer widget
     //call to register footer sidebar widgets
    register_sidebar( array(
            'id'            =&gt; 'my_footer2',
            'name'          =&gt; 'My Footer col 2',
            'before_widget' =&gt; '&lt;br /&gt;
&lt;div class=&quot;small-3 columns&quot; id=&quot;%1$s&quot; class=&quot;fwidget %2$s&quot;&gt;',
            'after_widget'  =&gt; '&lt;/div&gt;
&lt;p&gt;',
            'before_title'  =&gt; '&lt;br /&gt;
&lt;h3 class=&quot;widget-title&quot;&gt;',
            'after_title'   =&gt; '&lt;/h3&gt;
&lt;p&gt;',
    )); //end footer widget
//....and so on...
}
// and then we register the function which will be executed in the
// widgets_init phase of wp core
add_action( 'widgets_init' , 'my_widget_areas' );
</pre><p>If you read the code, it&#8217;s quite easy to understand (nearly, self explanatory).</p><p>Ok we are done now with the <strong>functions.php</strong> file.</p><h2>Accept the widgets in your theme.</h2><p>Now you will have to edit the footer.php files to make the place holders of your declared widgets areas.</p><p>Somewhere in your footer you&#8217;ll put this</p><pre class="wp-code-highlight prettyprint">
&lt;br /&gt;
&lt;div class=&quot;row&quot;&gt;
                    &lt;?php if(is_active_sidebar('my_footer1'))                              dynamic_sidebar('my_footer1'); ?&gt;
                &lt;?php if(is_active_sidebar('my_footer2')) :                             dynamic_sidebar('my_footer2');                          endif; ?&gt;
&lt;!-- end so on --&gt;
&lt;/div&gt;
&lt;p&gt;
</pre><p>Ok, now your declared widgets areas are now hooked to your footer&#8217;s theme.</p><p>Following the same principles, you can now create widgets areas anywhere on a page of your website.</p><h2>You&#8217;re in the admin now</h2><p>Well, you&#8217;ve already done the hard stuff. Now, if you go to appearance widgets you will see all the area you&#8217;ve declared in functions.php. You just have to drag and drop a widget in any of the area and it will appear on your site.</p><p>Crafting widgets area is a question of balancing html between your theme&#8217;s templates and &#8220;<em>before_</em>&#8221; &#8220;<em>after_</em>&#8221; attributes of your widget area.</p><p>And that&#8217;s it.</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/wordpress-2/custom-theme-widget-zones/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Oracle rows to columns for all Oracle Versions</title><link>http://www.sniptrichint.com/oracle/oracle-rows-to-columns-for-all-oracle-versions/</link> <comments>http://www.sniptrichint.com/oracle/oracle-rows-to-columns-for-all-oracle-versions/#comments</comments> <pubDate>Wed, 06 Mar 2013 11:15:42 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Oracle]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=491</guid> <description><![CDATA[<p><img
width="225" height="225" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/oracle.jpg" class="attachment-medium wp-post-image" alt="oracle" /></p>Ok, let&#8217;s say that you need to turn some rows into columns. For example, you have a table where you have information of a person span over several records. Record 1 contains the type of the person like this: person_id, attribute_id and value. example : 123, &#8216;CIVILSTATE&#8217;,'married&#8217; Now, you want each attribute to be a [...]]]></description> <content:encoded><![CDATA[<p><img
width="225" height="225" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/oracle.jpg" class="attachment-medium wp-post-image" alt="oracle" /></p><p>Ok, let&#8217;s say that you need to turn some rows into columns. For example, you have a table where you have information of a person span over several records.</p><p>Record 1 contains the type of the person like this: person_id, attribute_id and value.<br
/> example : 123, &#8216;CIVILSTATE&#8217;,'married&#8217;</p><p>Now, you want each attribute to be a column. Well, here is how it goes :</p><pre class="wp-code-highlight prettyprint">
select
  person_id ,
  max( decode( attribute_id, 'value of attribute_id', value, null ) ) as attr0 ,
  max( decode( attribute_id, 'value of attribute_id', value, null ) ) as attr1 ,
  max( decode( attribute_id, 'value of attribute_id', value, null ) ) as attr2
from your_table
where person_id = 123 and ...
group by person_id
</pre>]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/oracle/oracle-rows-to-columns-for-all-oracle-versions/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Oracle simple delete duplicates</title><link>http://www.sniptrichint.com/snippets-2/oracle-simple-delete-duplicates/</link> <comments>http://www.sniptrichint.com/snippets-2/oracle-simple-delete-duplicates/#comments</comments> <pubDate>Wed, 19 Dec 2012 08:37:02 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Oracle]]></category> <category><![CDATA[Snippets]]></category> <category><![CDATA[SQL]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=487</guid> <description><![CDATA[<p><img
width="225" height="225" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/oracle.jpg" class="attachment-medium wp-post-image" alt="oracle" /></p>Well, this is a fine statement to delete duplicates in a table : DELETE FROM table1 A WHERE A.rowid &#62; ANY ( SELECT B.rowid FROM table1 B WHERE A.ID = B.ID and any additional condition ) and other conditions on A;]]></description> <content:encoded><![CDATA[<p><img
width="225" height="225" src="http://www.sniptrichint.com/wp-content/uploads/2012/06/oracle.jpg" class="attachment-medium wp-post-image" alt="oracle" /></p><p>Well, this is a fine statement to delete duplicates in a table :</p><pre class="wp-code-highlight prettyprint">
DELETE FROM
   table1 A
WHERE
  A.rowid &gt;
   ANY (
     SELECT
        B.rowid
     FROM
        table1 B
     WHERE
        A.ID = B.ID and
        any additional condition
        )
   and other conditions on A;
</pre>]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/snippets-2/oracle-simple-delete-duplicates/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>XDate : Dates made easy in javaScript</title><link>http://www.sniptrichint.com/javascript-jquery/xdate-dates-made-easy-in-javascript/</link> <comments>http://www.sniptrichint.com/javascript-jquery/xdate-dates-made-easy-in-javascript/#comments</comments> <pubDate>Fri, 23 Nov 2012 15:49:34 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Javascript jQuery]]></category> <category><![CDATA[javascirpt]]></category> <category><![CDATA[jquery]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=476</guid> <description><![CDATA[Ever felt some problems when dealing with dates in your Javascript adventures ? Well, this tiny library will solve it al. take a date and add day, months, years, minutes&#8230;it will conpute it for you. Getters, setters, String date parsing. difference between dates or parts of dates Date formating UTC Mode Some cool utilities (today, [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.sniptrichint.com/wp-content/uploads/2012/11/xdate.jpg" rel="lightbox[476]" title="xdate"><img
class="alignleft size-medium wp-image-479" title="xdate" src="http://www.sniptrichint.com/wp-content/uploads/2012/11/xdate-300x172.jpg" alt="" width="300" height="172" /></a></p></p><p>Ever felt some problems when dealing with dates in your Javascript adventures ? Well, this tiny library will solve it al.</p><p>take a date and add day, months, years, minutes&#8230;it will conpute it for you.</p><ul><li>Getters,</li><li>setters,</li><li>String date parsing.</li><li>difference between dates or parts of dates</li><li>Date formating</li><li>UTC Mode</li><li>Some cool utilities (today, etc..)</li></ul><p>It supports also methods chaining.</p><p>Check this code :</p><pre class="wp-code-highlight prettyprint">
selectedDate = new XDate('2012-11-23');
selectedDate.addDays(7).toString(&quot;dd/M/yyyy&quot;);
</pre><p>&nbsp;</p><p>&nbsp;<br
/> Don&#8217;t wait more.Give it a try</p><p><a
title="XDate Javascript Library" href="http://arshaw.com/xdate/">http://arshaw.com/xdate/</a></p><hr/> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/javascript-jquery/xdate-dates-made-easy-in-javascript/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Beautiful URL in YII (without index)</title><link>http://www.sniptrichint.com/tip-of-the-day/beautiful-url-in-yii-without-index/</link> <comments>http://www.sniptrichint.com/tip-of-the-day/beautiful-url-in-yii-without-index/#comments</comments> <pubDate>Mon, 15 Oct 2012 08:39:32 +0000</pubDate> <dc:creator>xav</dc:creator> <category><![CDATA[Tip of the day]]></category> <category><![CDATA[Yii]]></category> <guid isPermaLink="false">http://www.sniptrichint.com/?p=471</guid> <description><![CDATA[<p><img
width="200" height="200" src="http://www.sniptrichint.com/wp-content/uploads/2012/10/yii.jpg" class="attachment-medium wp-post-image" alt="yii" /></p>Ok, here goes a fine tip to remove the &#8220;index.php&#8221; from the URL. I did it on Apache with mod_rewrite on. In your httpd.conf file LoadModule rewrite_module modules/mod_rewrite.so First of, create a .htaccess file in the roor directory of your webapp (where index.php is), and put the following in it RewriteEngine on # if a [...]]]></description> <content:encoded><![CDATA[<p><img
width="200" height="200" src="http://www.sniptrichint.com/wp-content/uploads/2012/10/yii.jpg" class="attachment-medium wp-post-image" alt="yii" /></p><p>Ok, here goes a fine tip to remove the &#8220;index.php&#8221; from the URL. I did it on Apache with mod_rewrite on.</p><p>In your httpd.conf file</p><pre class="wp-code-highlight prettyprint">
LoadModule rewrite_module modules/mod_rewrite.so
</pre><p>First of, create a .htaccess file in the roor directory of your webapp (where index.php is), and put the following in it</p><pre class="wp-code-highlight prettyprint">
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</pre><p>OK. Now it&#8217;s time to make some changes in the protected/config/main.php file.</p><p>Find the URLManager section and swap it for this.</p><pre class="wp-code-highlight prettyprint">
'urlManager'=&gt;array(
    'urlFormat'=&gt;'path',
    'showScriptName'=&gt;false,
     'caseSensitive'=&gt;false,
),
</pre><p>Et voilà, this worked for me.</p> ]]></content:encoded> <wfw:commentRss>http://www.sniptrichint.com/tip-of-the-day/beautiful-url-in-yii-without-index/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <series:name><![CDATA[Beginning with Yii]]></series:name> </item> </channel> </rss><!-- Dynamic page generated in 0.182 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-06-18 18:10:38 -->
