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 | |
| // -- Test JSMin | |
| require( 'min/lib/JSMin.php' ); | |
| $file = 'jquery-1.10.2.js'; | |
| $pi = pathinfo( $file ); | |
| $filemin = $pi[ 'filename' ] . '-jsmin.' . $pi[ 'extension' ]; | |
| if ( file_exists( $file ) ) { | |
| $source = file_get_contents( $file ); | |
| $res = JSMin::minify( $source ); | |
| file_put_contents( $filemin, $res ); |
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 | |
| class JSCompressor { | |
| const COMPRESS_METHOD_JSMIN = 1; | |
| const COMPRESS_METHOD_JSMIN_PLUS = 2; | |
| public static function minify( $file, $newfile = null, $compress_method = self::COMPRESS_METHOD_JSMIN, $debug = false ) { | |
| if ( $debug ) | |
| $time_start = microtime( true ); |
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"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Select tag</title> | |
| </head> | |
| <body> | |
| <script src="jquery-1.10.2.js"></script> | |
| <script> | |
| jQuery(document).ready(function($){ |
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 | |
| /** | |
| * This function is to replace PHP's extremely buggy realpath(). | |
| * @param string The original path, can be relative etc. | |
| * @return string The resolved path, it might not exist. | |
| */ | |
| public static function truepath( $path ) | |
| { | |
| // whether $path is unix or not | |
| $unipath = strlen( $path ) == 0 || $path{0} != '/'; |
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"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Select tag</title> | |
| </head> | |
| <body> | |
| <ul id="file-system"> | |
| <li> | |
| <img src="images/folder.png" alt=""> |
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 basename( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /.*\//, '' ); | |
| } | |
| function dirname( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /\/[^\/]*$/, '' ); | |
| } | |
| console.log( dirname( '/srv/www/dev/umid/admin/cfg.admin.php' ) ); |
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"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>jQuery Simple Plugin Example</title> | |
| </head> | |
| <body> | |
| <p class="wow">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem deleniti dolorem fugit maiores, nulla | |
| quam quos. |
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_flag log_errors on | |
| php_flag display_errors on | |
| # E_ALL = 30719 | |
| php_value error_reporting 30719 | |
| php_value error_log /var/www/domains/example.com/php.error.log |
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
| var file = "some-file.pdf"; | |
| var ext = file.split( '.' ).pop(); | |
| console.log('File extension is', ext); |
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"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Upload File using jQuery.ajax() with progress support</title> | |
| </head> | |
| <body> | |
| <input type="file" name="file" id="sel-file"/> |