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
// Fix for BS 3.1 modal remote loading. | |
$(document).on("hidden.bs.modal", function (e) { | |
$(e.target).removeData("bs.modal").find(".modal-content").empty(); | |
}); |
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 __construct() | |
{ | |
// Perform CSRF check on all post/put/patch/delete requests | |
$this->beforeFilter('csrf', array('on' => array('post', 'put', 'patch', 'delete'))); | |
} |
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 | |
// Requires PHP >= 5.3 | |
function age($birthdate) | |
{ | |
return date_create($birthdate)->diff(date_create("today"))->y; | |
} | |
?> |
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 | |
// Requires >= PHP 5.3 | |
usort($source_array, function($a, $b) { | |
return strcmp($a['key'], $b['key']); | |
}); | |
?> |
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
$(window).load(function(){ | |
if(window.location.hash) { | |
$('a[href="'+window.location.hash+'"]').click(); | |
} | |
}); |