Skip to content

Instantly share code, notes, and snippets.

View dharmang's full-sized avatar

Dharmang dharmang

  • Ahmedabad, Gujarat, India
View GitHub Profile
@dharmang
dharmang / foreach-example.js
Created January 16, 2018 06:56
JavaScript foreach example.
const data = [1,2,35,4,3,2,1];
for(const item of data) {
console.log(item);
}
/*here fetch is imaginary function*/
const data = [
@dharmang
dharmang / Gmail SMTP Example
Created May 13, 2015 06:23
Gmail SMTP Example
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require 'phpmailer/PHPMailerAutoload.php';