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
| jQuery(function($) { | |
| $('form[data-async]').live('submit', function(event) { | |
| var $form = $(this); | |
| var $target = $($form.attr('data-target')); | |
| $.ajax({ | |
| type: $form.attr('method'), | |
| url: $form.attr('action'), | |
| data: $form.serialize(), |
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 | |
| /** | |
| * Create a bootstrap | |
| * @param String $bold - First words in the alert. Will be put inside <strong> html tag for emphasis | |
| * @param String $level - second words in the alert. Will be put inside <class> html tag for alert severity | |
| * @param String $message - What will be used for the main description in the alert | |
| */ | |
| function Alert($bold, $level, $message) | |
| { |
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 folderSize($dir){ | |
| $size = 0; | |
| foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) { | |
| $size += is_file($each) ? filesize($each) : folderSize($each); | |
| } | |
| return $size; | |
| } |
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
| // vim: syntax=PHP | |
| function test_input($data) { | |
| $data = trim($data); | |
| $data = stripslashes($data); | |
| $data = htmlspecialchars($data); | |
| return $data; | |
| } |