Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Sheikh Hussnain hussnainsheikh

🎯
Focusing
View GitHub Profile
@hussnainsheikh
hussnainsheikh / showtables.php
Created Sep 21, 2017
This is simple PHP script which shows all the tables of a database. You just need to provide database details. It can be helpful if we just have database details and do not know about the database tables.
View showtables.php
<?php
$db = 'database'; //Database name
$host = 'host'; //Hostname or Server ip
$user = 'database_user'; //Database user
$pass = 'password'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
@hussnainsheikh
hussnainsheikh / simple_calculator.html
Created Oct 17, 2017
Simple basic Calculator using javaScript. Functions addition, subtraction, multiplication and division with maintaining history of previous answer.
View simple_calculator.html
<!-- Basic calculator using javaScript -->
<html>
<head>
<title>Calculator</title>
<style type="text/css">
.field{
padding: 4px;
border-radius: 4px;
border: solid black 1px;
margin: 3px;
@hussnainsheikh
hussnainsheikh / simple_calculator_using_jquery.html
Created Nov 2, 2017
Simple basic Calculator using jQuery. It includes addition, subtraction, multiplication and division. It also keep record of previous answers. Enjoy!
View simple_calculator_using_jquery.html
<!-- Basic calculator using jQuery -->
<html>
<head>
<title>Calculator</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<style type="text/css">
.field{
padding: 4px;
border-radius: 4px;
border: solid black 1px;
@hussnainsheikh
hussnainsheikh / Transfer_with_extraction.php
Last active Nov 6, 2017 — forked from musamamasood/transfer.php
Transfer files to server with publicly accessible zip file with extraction using PHP Copy and PHP ZipArchive. You just have to change the $remote_file_url and then upload this file on destination server and execute the file.
View Transfer_with_extraction.php
<?PHP
/**
* Transfer Files Server to Server using PHP Copy and PHP ZipArchive
* @link http://glowLogix.com
*/
/* Source File URL */
$remote_file_url = 'http://example.com/filename.zip';
/* New file name and path for this file */
@hussnainsheikh
hussnainsheikh / tables_backup.php
Created Nov 6, 2017
Back up database tables.
View tables_backup.php
<?php
$dbhost = 'DB_Host'; // Database Host
$dbuser = 'DB_User'; // Database User
$dbpass = 'DBUser_Password'; // Database User Password
$db='DB_Name'; // Database Name
$i=0;
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db);
@hussnainsheikh
hussnainsheikh / show_columns.php
Created Dec 19, 2017
Simple PHP script to show columns name of a database table.
View show_columns.php
<?php
$db = 'Database'; //Database name
$host = 'Database_host'; //Hostname or Server ip
$user = 'USER'; //Database user
$pass = 'Password'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
@hussnainsheikh
hussnainsheikh / show_databases.php
Created Dec 19, 2017
Simplet php script to show all DATABASES which are created on a host. Enjoy!
View show_databases.php
<?php
$host = 'HOST'; //Hostname or Server ip
$user = 'USER'; //Database user
$pass = 'PASS'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
$count = 0;
@hussnainsheikh
hussnainsheikh / shopify_delete_all_products.php
Last active Feb 6, 2018
Simple PHP script to delete all products from Shopify store using a private App(Api key and Pass). Just replace your App info and enjoy. Thanks
View shopify_delete_all_products.php
<?php
/**
*
*/
class ShopifyProducts{
public function getProducts($count = false, $page){
$apikey = 'API_KEY'; //Replace with your's
$pass = 'PASS'; //Replace with your's
$store = 'STORE_URL'; //Replace with your's
if ($count == true) {
@hussnainsheikh
hussnainsheikh / Programs.cpp
Last active Feb 17, 2018
Simple Problems solution in C++. Please find the comment below for Problem statements.
View Programs.cpp
Program No 1:
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
View install_mysql.md

How to install mysql on ubuntu (which works)

first delete it in case a root password was previously created:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

then install it: