Bits N Tricks

A platform to contribute to the best of our knowledge so someone else can be benefited.

Subversion – Rules, Crash Course and Work Cycle 09Jun, 2010

Subversion – Rules, Crash Course and Work Cycle

RULES Rule #1: Check in only completed functioning code that you believe works. Bugs may be found later, but don’t check in anything that you know is incomplete or broken. Rule #2: Check in as often as possible without breaking rule #1. Rule #3: Always perform an update before a check-in. Rule #4: Reference the svn red book often. http://svnbook.red-bean.com/ Rule #5: Do not mess around with the .svn directories in the check-out unless you’re an expert with subversion. CRASH COURSE: Subversion (svn) is a source code repository like microsoft sourcesafe, cvs, or borland starteam. The main repository we use is called simply ‘main’. Beneath main, everything is organized into projects. There is a project for the main website itself,…

Posted in: SVN
How to install, configure and use SVN (Subversion) 09Jun, 2010

How to install, configure and use SVN (Subversion)

To access your online repository (http://dev.w3syntactic.com/poemsandgifts/) from your Windows based operating system, you should install one of the SVN client applications. Here, we will be discussing about TortoiseSVN. To install TortoiseSVN client application on your system, you can find it at http://tortoisesvn.tigris.org or rather at http://tortoisesvn.net/downloads. There you will find two types of installers – one for 32-bit operating systems and another one for 64-bit operating systems. To check how many bit operating system you have – click here. Once you have downloaded the right version of TortoiseSVN. Get it installed with the default selections with the installer on your system. If successfully installed, it will ask you to restart your system. Thus, get your system restarted and in the…

Posted in: SVN, TortoiseSVN
Installing Subversion (SVN) using Dreamhost 09Jun, 2010

Installing Subversion (SVN) using Dreamhost

Login to your dreamhost account. On the left navigation bar, click on Goodies and then “Subversion” Under “Create a new Subversion Project:” – input all the necessary values and click on the button called “Create my new project repository now!” Dreamhost Subversion Once after clicking on that button and if everything has been inputted correctly, your request for the SVN for your new project will be submitted and you will be provided with a message something similar to the below one: Once your project’s subversion has been created online and once you will open up the subversion in your browser for the first time, it will look somewhat like this:

Posted in: Dreamhost, SVN
PHP script – how to find the working days from a specified date? 21May, 2010

PHP script – how to find the working days from a specified date?

<?php /* This is a function to find out working days from a specified date and format of date must be dd-mm-yyyy First parameter to function is the date from which working days are to be calculated (working day exclude Sun and Sat) Second parameter to function is the number of working days to be calculated */ function workingDays( $fromDate, $interval ) { $date_array = explode(‘-‘, $fromDate ); $day = $date_array[0]; $month = $date_array[1]; $year = $date_array[2]; $working_date = array(); for ( $i = 1; $i <= $interval; $i++ ) { $day_text = date(“D”, mktime( 0, 0, 0,$month,$day + (int)$i,$year)); if( $day_text == ‘Sat’ || $day_text == ‘Sun’ ) { $interval++; continue; } $working_date[] = date(“F j, Y”, if (1==1)…

Posted in: PHP
How to check if Windows 7, Vista, XP or Server 2003 is 32-bit or 64-bit (x86 or x64) version? 12Mar, 2010

How to check if Windows 7, Vista, XP or Server 2003 is 32-bit or 64-bit (x86 or x64) version?

Windows Vista Method 1 Click Start, then click on Run or Start Search. Type msinfo32.exe and then press Enter key. In “System Information”, review the value for the System Type item: For 32-bit editions of Windows, the value of the System Type item is x86-based PC. For 64-bit editions of Windows, the value of the System Type item is x64-based PC. Method 2 Click Start, type system in the “Start Search” box, and then click system in the “Programs” list. The operating system appears as follows: For a 64-bit version operating system: 64-bit Operating System appears for the “System type” under “System”. For a 32-bit version operating system: 32-bit Operating System appears for the “System type” under “System”. Method 3…

Posted in: Windows
How to convert HTML to PDF using PHP 5 18Feb, 2010

How to convert HTML to PDF using PHP 5

There are many tools on the internet that allow you to convert files of various formats to PDF – but sometimes you need to make such conversions using your code. In this article, we’ll specifically discuss how to convert an HTML file or content to a PDF file using PHP 5. For the task at hand, we’ll be using Dompdf – a CSS2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer – it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes. Installation Download the latest stable version of Dompdf, additionally you can also download the detailed documentation if…

Posted in: HTML, PDF, PHP