This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tinymce.init({ | |
selector: 'textarea', // change this value according to your HTML | |
theme: "modern", | |
paste_data_images: true, | |
plugins: [ | |
"advlist autolink lists link image charmap print preview hr anchor pagebreak", | |
"searchreplace wordcount visualblocks visualchars code fullscreen", | |
"insertdatetime nonbreaking save table contextmenu directionality", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sets up our arrays | |
$array1 = [1, 3, 5, 7, 9]; | |
$array2 = [2, 4, 6, 8, 10]; | |
$array3 = []; | |
// Determines how many items we have in each array | |
$array1_count = count($array1); | |
$array2_count = count($array2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arr_diff (a1, a2) { | |
var a = [], diff = []; | |
for (var i = 0; i < a1.length; i++) { | |
a[a1[i]] = true; | |
// a = [a: true, b: true, x: true] | |
// console.log(a1[i]); | |
} | |
//console.log(a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<style media="screen"> | |
#map_canvas { | |
width: 980px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App\Http\Controllers\Auth; | |
class LoginController extends Controller | |
public function redirectTo(){ | |
$roles = Auth::user()->roles; | |
if(!is_null($roles )){ | |
foreach (Auth::user()->roles as $role) { | |
if($role->name == "SUPER_ADMIN"){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
seconds: | |
12879 | |
6262 | |
metrs: | |
130229 | |
*/ | |
print 12879 / 60; | |
echo '<br>Hours : '. floor(12879 / 3600); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$start_date = new DateTime('2007-09-01 04:10:58'); | |
$since_start = $start_date->diff(new DateTime('2012-09-11 10:25:00')); | |
echo $since_start->days.' days total<br>'; | |
echo $since_start->y.' years<br>'; | |
echo $since_start->m.' months<br>'; | |
echo $since_start->d.' days<br>'; | |
echo $since_start->h.' hours<br>'; | |
echo $since_start->i.' minutes<br>'; | |
echo $since_start->s.' seconds<br>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$datas = explode("/",'23/04/2018'); | |
$correctDAta = $datas[2].'-'.$datas[1].'-'.$datas[0].' 10:00:00'; | |
echo $correctDAta; | |
echo '<hr>'; | |
$time = explode(":",'02:50:50'); | |
//var_dump($time); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo sum_the_time('01:20:22', '02:10:00'); // this will give you a result: 19:12:25 | |
function sum_the_time($time1, $time2) { | |
$times = array($time1, $time2); | |
$seconds = 0; | |
foreach ($times as $time) | |
{ | |
list($hour,$minute,$second) = explode(':', $time); | |
$seconds += $hour*3600; | |
$seconds += $minute*60; |
OlderNewer