Create Form 

<div class="col-sm-6 col-md-6 col-lg-6 contact_left">
<form class="contact_main-form" action="sendMail.php" method="post" id="my_form">
<div class="form-group">
<label class="text_name_c_form">Name:</label>
<input type="text" class="form-control input_form_c" id="Email" name="name" required>
</div>
<div class="form-group">
<label class="text_name_c_form">Email:</label>
<input type="email" class="form-control input_form_c" id="Email" name="email" required>
</div>
<div class="form-group">
<label class="text_name_c_form">Subject:</label>
<input type="text" class="form-control input_form_c" id="Email" name="subject" required>
</div>

<div class="form-group">
<label class="text_name_c_form msg_1">Message:</label>
<textarea class="form-control input_form_c text-area" rows="3" name="msg" minlength=50 required></textarea>
</div>

<button type="submit" name="submit" class="btn btn-default">Send</button>

<div class="g-recaptcha" data-sitekey="your key"></div>

</form>
<div id="server-results"><!-- For server results --></div>

</div>

sendMail.php

<?php
$email;$message;$captcha; $subject;
$ToEmail = 'your@testmail.com';
$EmailSubject = 'Site contact form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$name = "Name: ".$_POST["name"]."";
$email .= "Email: ".$_POST["email"]."";
$sub .= "Subject: ".nl2br($_POST["subject"])."";
$msg .= "Message: ".nl2br($_POST["msg"])."";
$content = '<div style="width:90%;margin:0 auto;text-align:left;padding-left:4px">

<strong>First Name:</strong> '.$name.'<br>

<strong>Subject:</strong> '.$sub.'<br>

<strong>Email:</strong> '.$email.'<br>

<strong>Message:</strong> '.$msg.'<br>

.</div>';
if ($_POST["email"]<>'') {

if(isset($_POST['email'])){
$email=$_POST['email'];

}
if(isset($_POST['subject'])){
$subject=$_POST['subject'];
}

if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
echo '<h2>Please check the the captcha form.</h2>';

}
$secretKey = "Your Google Secret key";
$ip = $_SERVER['REMOTE_ADDR'];
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true); ?>
<?php
if(intval($responseKeys["success"]) !== 1) { ?>
<?php } else { ?> <?php
mail($ToEmail, $EmailSubject, $content , $mailheader) or die ("Failure"); ?>
<div class="alert alert-success"> <strong>Thank you for your message!
We will answer you within maximum 48h check</strong>
</div>
<?php
}
}
?>

Ajax

jQuery("#my_form").submit(function(event){
event.preventDefault(); //prevent default action
var post_url = $(this).attr("action"); //get form action url
var request_method = $(this).attr("method"); //get form GET/POST method
var form_data = new FormData(this); //Creates new FormData object
jQuery.ajax({
url : post_url,
type: request_method,
data : form_data,
contentType: false,
cache: false,
processData:false
}).done(function(response){ //
$("#server-results").html(response);
});
});

<script src="http://maps.google.com/maps/api/js?key=YourKey&callbacksensor=false"></script>
 
Call Where you want to show Map 
<div id="map" style="width: 500px; height: 400px;"></div>

<script>
var locations = [
[
“Your adress1”,
28.541868,
77.1161973,
1,

],
[
“Your adress2”,
28.634747,
77.2187213,
2,

],
[
“Your adress3”,
28.567317,
77.2390653,
3,

],

]

var map = new google.maps.Map(document.getElementById(‘map’), {
zoom: 8,
// center: new google.maps.LatLng(-33.92, 151.25),
center: new google.maps.LatLng(28.541868, 77.1161973),
mapTypeId: google.maps.MapTypeId.ROADMAP
});

var infowindow = new google.maps.InfoWindow();

var marker, i;

for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});

google.maps.event.addListener(marker, ‘click’, (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0], locations[i][6]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>

Magento1.x version we can use this
For Phtml File

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>

Use Phtml In static block

{{block type=”core/template” template=”test/test.phtml”}}

Magento2.x
For Phtml Files similar to Magento 1

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?>

Use Phtml In static block

{{block class=”Magento\\Cms\\Block\\Block” block_id=”block_identifier”}}

Magento 2 has one command-line interface that performs both installation and configuration tasks. Console component is one of the new features in Magento 2. Find various command here.

Debug
There are three mode default, developer, production.
To check the current mode:

1
php bin/magento deploy:mode:show

Set new mode

1
php bin/magento deploy:mode:set developer

Deploy
The static view files deployment command enables you to write static files to the Magento file system.

1
php bin/magento setup:static-content:deploy

For specific theme

1
php bin/magento setup:static-content:deploy --theme Magento/backend  --theme yourthemename/default

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStore = $storeManager->getStore();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
$tableName = $resource->getTableName('my_table'); // the table name in this example is 'my_table'
$sql1 = "SELECT * FROM " . $tableName;
$result1 = $connection->fetchAll($sql1);
echo '<pre>'; print_r($result1); echo '</pre>'