Skip to content

Instantly share code, notes, and snippets.

public function sendEmail($id,$password){
$data = Login::find($id);
$message = "<p>
Thank you for registering with Ques Tag.
</p>
below is your login details
<p>
Email: ". $data['email']."
Password: ".$password."
</p>
var video = document.getElementsByTagName('video')[0];
//console.log(video.seekable.start(0));
console.log(video.seekable);
//console.log(video.played.end(0));
var i = setInterval(function() {
if(video.readyState > 0) {
var minutes = parseInt(video.duration / 60, 10);
var seconds = video.duration % 60;
console.log(minutes+':'+seconds);
// (Put the minutes and seconds in the display)
document.getElementById('video-cnt').addEventListener('ended',myHandler,false);
document.getElementById('video-cnt').addEventListener('play',Start,false);
function myHandler(e) {
that.sendGa("Button-Custom_TVC_Video_Ended-Clicked");
console.log('ended');
// What you want to do after the event
}
function Start(){
// What you want to do after the event
@stormbreakers
stormbreakers / check_date.js
Created January 29, 2016 15:19
check if start date is greater than end date
function checkTime() {
start = $("#startDate").val();
end = $("#endDate").val();
if((Date.parse(start) > Date.parse(end))) {
$("#startDate").focus();
alert('Incorrect Start time and End time');
return false;
}else{
return true;
@stormbreakers
stormbreakers / onerror.js
Created February 11, 2016 06:30 — forked from daniellmb/onerror.js
Automagically look up JavaScript errors on Stack Overflow ;-)
window.onerror = function(message) {
top.location.href = 'http://stackoverflow.com/search?q=' +
encodeURIComponent(message + ' [js]');
};
$FirstDay = date("Y-m-d", strtotime('today'));// today's date
$LastDay = date("Y-m-d", strtotime($FirstDay.' +6 day'));// +6 days date
echo $date = date("Y-m-d",strtotime('monday this week')).' To '.date("Y-m-d",strtotime("sunday this week"));
$FirstDay = date("Y-m-d", strtotime('monday this week'));// this monday's date
$LastDay = date("Y-m-d", strtotime('sunday this week'));// this sundays's date
@stormbreakers
stormbreakers / readyState.js
Created March 8, 2016 10:34 — forked from AllThingsSmitty/readyState.js
Using readyState to show document state
// credit: Louis Lazaris
document.onreadystatechange = function () {
switch (document.readyState) {
case 'loading':
console.log('loading...');
break;
case 'interactive':
console.log('DOM is ready...');
break;
case 'complete':
@stormbreakers
stormbreakers / aes_enc_dec.php
Created March 8, 2016 11:44 — forked from turret-io/aes_enc_dec.php
AES encryption/decryption in PHP
<?php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well
var state = [
"Andaman and Nicobar Islands",
"Andhra Pradesh",
"Arunachal Pradesh",
"Assam",
"Bihar",
"Chandigarh",
"Chhattisgarh",
"Dadra and Nagar Haveli",
"Delhi",
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master