Skip to content

Instantly share code, notes, and snippets.

View mahedi2014's full-sized avatar
๐Ÿ™‚

Mahedi Azad mahedi2014

๐Ÿ™‚
View GitHub Profile
@mahedi2014
mahedi2014 / media_gallery.php
Created June 4, 2016 06:14
Select image from media gallery
@mahedi2014
mahedi2014 / google_map.php
Created April 30, 2016 05:22
Display location on google map from address using javascript google map api
<div id="map" style="width:70%;height:500px;"></div>
<h5>Tolarbag Mosque Road, Dhaka, Dhaka Division, Bangladesh</h5>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var geocoder = new google.maps.Geocoder(); // initialize google map object
var address = "Tolarbag Mosque Road, Dhaka, Dhaka Division, Bangladesh";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
@mahedi2014
mahedi2014 / google_address.php
Created April 30, 2016 05:21
Auto Complete address form using google map api
<!DOCTYPE html>
<html>
<head>
<title>Place Autocomplete Address Form</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
@mahedi2014
mahedi2014 / index.php
Created April 11, 2016 11:13
html5 CACHE MANIFEST
<!DOCTYPE html>
<html lang="en" manifest="offline.php">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/>
<link rel="stylesheet" href="styles.css"/>
</head>
<body>
<div class="container">
@mahedi2014
mahedi2014 / print a div in js.html
Created April 2, 2016 04:30
js print a div html
<!DOCTYPE html>
<html>
<head>
<script>
function printContent(el){
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById(el).innerHTML;
document.body.innerHTML = printcontent;
window.print();
document.body.innerHTML = restorepage;
@mahedi2014
mahedi2014 / notification.html
Created December 4, 2015 09:26
Real time desktop notification with vanilla js
<!DOCTYPE html>
<html>
<head>
<title>Desktop notification</title>
<script type="text/javascript">
var articles = [
["Md. Mahedi Azad","Programmer and Web Developer","http://mahediazad.me"],
["Md. Mahedi Azad","Programmer and Web Developer","http://mahediazad.me"],
["Md. Mahedi Azad","Programmer and Web Developer","http://mahediazad.me"],
@mahedi2014
mahedi2014 / orcl_limit.sql
Created November 8, 2015 06:58
Oracle limit query like mysql
###Query
select * from
( select temp_table.*, ROWNUM rnum from
( <your_query_goes_here, with order by> ) temp_table
where ROWNUM <= :MAX_ROW_TO_FETCH )
where rnum >= :MIN_ROW_TO_FETCH;
###Instruction
:MAX_ROW_TO_FETCH is the maximum limit of row that be displayed
@mahedi2014
mahedi2014 / PasswordPolicy.php
Last active October 1, 2015 10:15
Password policy
<?php
/**
* Password policy
*
* Created by Mahedi Azad.
* User: Mahedi Azad
* Date: 01-Oct-15
* Time: 9:45 AM
*/
@mahedi2014
mahedi2014 / phpmailer.php
Created September 13, 2015 10:17
Send mail with phpmailer and gmail smtp
<?php
//add to composer.json "phpmailer/phpmailer": "~5.2"
require_once 'vendor/autoload.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->SMTPAuth = true;
$mail->Host = 'smtp.gmail.com'; // "ssl://smtp.gmail.com" didn't worked
@mahedi2014
mahedi2014 / curlFopen.php
Created September 4, 2015 04:12
Using curl and fopen
<?php
/*
go=1 (hidden)
hp='value from textbox'
message='value from texarea'
c='captcha image'
*/
/**Data generation**/
$vars = array(