This file contains 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 $results = [ | |
[ | |
"date"=> $_GET['sort'], | |
"message"=> "User \"Beheerder, Systeem\" has been working for more than 12 hours 19.5 hours total", | |
"status"=> 0, | |
"user_name"=> "Beheerder, Systeem" | |
], | |
[ | |
"date"=> "22-04-2013 04=>00", | |
"message"=> "User \"Beheerder, Systeem\" has been working outside office hours on 22-04-2013 04=>00", |
This file contains 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
public function save($path, $array) | |
{ | |
$data = "<?php\nreturn array("; | |
foreach ($array as $key => $value) { | |
$data .= "'" . $key . "'=>". var_export($value,true).';' . "\n"; | |
} | |
$cdata .= "\n);"; | |
//make sure directory exists before creating | |
return file_put_contents($path, $data); | |
} |
This file contains 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 get_client_language($availableLanguages, $default='en'){ | |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
foreach ($langs as $value){ | |
$choice=substr($value,0,2); | |
if(in_array($choice, $availableLanguages)){ | |
return $choice; | |
} | |
} |
This file contains 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
<a href='#t-rex' onclick='return getDinoInfo("t-rex");'>T-Rex</a><br /> | |
<a href='#brachiosaurus' onclick='return getDinoInfo("brachiosaurus");'>Brachiosaurus</a><br /> | |
<a href='#pterodactylus' onclick='return getDinoInfo("pterodactylus");'>Pterodactylus</a> | |
<div id='dino-details'></div> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type='text/javacript'> | |
$(document).ready(function() { | |
//makes sure that the window.location.hash exists |
This file contains 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
$("a").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" | |
}, { | |
duration: 500, | |
easing: "swing" | |
}); | |
return false; | |
}); |
This file contains 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
var loading = false; | |
$(window).scroll(function(){ | |
if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){ | |
if(loading == false){ | |
loading = true; | |
$('#loadingbar').css("display","block"); | |
$.get("load.php?start="+$('#loaded_max').val(), function(loaded){ | |
$('body').append(loaded); | |
$('#loaded_max').val(parseInt($('#loaded_max').val())+50); | |
$('#loadingbar').css("display","none"); |
This file contains 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
<html> | |
<head> | |
<title>Nooooo!</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<style> | |
li { | |
position:relative; | |
} | |
a.collapsed + ul { | |
opacity: 0; |
This file contains 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
<html> | |
<head> | |
<title>Center dialog that shrinks!</title> | |
<style> | |
body {padding:0;margin:0;} | |
#floater {float:left; height:50%; margin-bottom:-300px;} | |
#content {clear:both; height:100%; position:relative; max-height: 600px; max-width: 700px; box-shadow: inset 0 0 10px #000000; margin: 0 auto;} | |
</style> | |
</head> | |
<body> |
This file contains 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 | |
$boolean = true; | |
$array = <<<'EOT' | |
[ | |
'db'=>'mydb', | |
'user'=>'root', | |
'pass'=>'', | |
'host'=>'localhost', |
This file contains 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 q(expr, con) { | |
return [].slice.call((con || document).querySelectorAll(expr)); | |
} |
OlderNewer