Skip to content

Instantly share code, notes, and snippets.

View jagad89's full-sized avatar

Bhavin Jagad jagad89

  • Vadodara, Gujarat
View GitHub Profile
@jagad89
jagad89 / Restoring large file in MSSQL
Created May 9, 2016 15:02
Restoring or Import large file in MSSQL using sqlcmd
sqlcmd -S <Servername> -U <Username> -P <password> -d <Databasename> -i <filename> -a 32767
@jagad89
jagad89 / popunder.js
Created April 5, 2016 13:50
pop under js
<!--Start Popunder-->
<script>
var puShown = false;
var PopWidth = 1370;
var PopHeight = 800;
var PopFocus = 0;
var _Top = null;
function GetWindowHeight() {
@jagad89
jagad89 / ADBviaWifI.txt
Created November 20, 2015 10:53
Connecting ADB via WiFi for Debugging
In order to enable adb connection over Wi-Fi, you first need to plug your device into your computer using USB as
you normally do. Also, make sure your computer and your Android device are connected to the same Wi-Fi. You also
need to know the IP address of your Android device, which you can find on your device by choosing Settings➪
Wi-Fi➪Advanced. In the bottom of the list that appears you will find your device IP address for the current Wi-Fi.
After you have this set up correctly, run the following commands from your terminal:
$ adb devices
List of devices attached
0070015947d30e4b device
$ adb tcpip 5555
$ adb connect 192.168.1.104
@jagad89
jagad89 / rackspaceservice.sh
Created November 18, 2015 07:25
Rackspace apache and mysql restart
sudo /usr/sbin/apachectl restart
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo /sbin/service mysqld start
@jagad89
jagad89 / switch-iis-to-apache
Last active November 7, 2015 07:02
Stop IIS server and start wampapache on Windows. Save this file as .bat and run as admin.
@net stop was /y
@net stop MsDepSvc /y
@net start wampapache
>sqlcmd -S tcp:<serverid/server instance name> -U <username> -P <password> -Q "SELECT SessionID ,IPAddress,StartTime,Hit,UserExists,IPCheckOK,EndTime
,uID FROM DP_FootyEye_Beta.dbo.AdminAccessLog" -o "C:\output.csv" -h -1 -s ,
@jagad89
jagad89 / xml to array
Created August 27, 2014 08:55
Three line xml2array
<?php
$xml = simplexml_load_string($xmlstring);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
?>
@jagad89
jagad89 / logger
Created August 19, 2014 09:48
simple string log
<?php
private function log($str)
{
$file = fopen("new.txt", "a+");
fwrite($file,"$str\n");
fclose($file);
}
1) Required All tables must have a primary key that is comprised of one column. Tables without a primary key or a composite primary key are not supported with ORM.
2) Recommended All table relationships should be explicitly defined with a foreign key constraint.
3) Recommended All tables and columns are lower-case with underscore characters as a delimiter. For example `purchase_order` not `Purchase Order`, `purchaseOrder`, etc. This will affect the builder's ability to create cleanly named classes for your model.
4) Recommended Use singular names for your tables. For example use a table name `customer`, not `customers`. Using singular names will help the builder to guess appropriate singular/plural class names for your model.
5) Optional Give each table a unique column prefix. For example the customer table columns might be c_id, c_name, c_age, etc. This makes writing reporter classes easier, but is not required.
@jagad89
jagad89 / mysqli.php
Created June 24, 2014 09:20
first step with Mysqli extension
<?php
// Connect to database
$connection = new mysqli("localhost", "username", "password", "databasename");
if($connection->connect_errno)
{
die( "Error Number : ". $connection->connect_errno . "<br> Error Message: ". $connection->connect_error );
}
// query() method to execute any query.