Skip to content

Instantly share code, notes, and snippets.

@tejnri
tejnri / dbscript_creator
Last active December 22, 2015 13:49
Dbscripts should be checked into the repository just like we checkin code. This helps us to trackdown what we have done with the database in course of time. Apart from that we also should have the ability to recreate the database from the available dbscripts. Recreating database from dbscripts require that dbscripts should be executed in datewis…
#!/usr/local/lamp_dev_64/php/bin/php
<?php
/**
* db script creator script.
*
* Dbscripts should be checked into the repository just like we
* checkin code. This helps us to trackdown what we have done with
* the database in course of time. Apart from that we also should
* have the ability to recreate the database from the available
* dbscripts. Recreating database from dbscripts require that dbscripts
@tejnri
tejnri / PDOBasic
Last active December 20, 2015 19:19
This file shows the basic operations to be done in PDO. PDO is a database abstraction layer so all the operations whether its done on any database. It will be same. The only exception is that the queries may be different to different databases
<?php
/*
* Trying to mess around with php PDO driver
* This is now de-facto standard for querring
* so many databases through PHP.
*/
/**
* Pre-requirement to run this file.
@tejnri
tejnri / Git Commands
Last active December 20, 2015 04:19
Common Git commands
Common git commands
-------------------
Start:
------
git init : to initialize a empty project.
git clone <git url> <path to store> : Get some others project. But this will only give master branch.
git checkout -b <branchname> origin/<other branch name> : This will fetch the branch from remote you want but this command could only be run after 2nd command.