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 url = 'http://spring4u.info/' | |
window.open(url, '_blank').focus() |
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
<!-- "allowfullscreen" controll whether fullscreen button --> | |
<iframe id="video_frame" class="embed-responsive-item" src="https://www.youtube.com/embed/jS3HN7Nw-qU" allowfullscreen></iframe> |
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
// Stop scroll while pop up | |
$("body").css("overflow", "hidden") | |
// Reset the scroll for page | |
$("body").css("overflow", "") |
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 | |
$text = $_POST['content']; | |
$lineArray = explode("<br />", nl2br($text)); |
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 CategoryHandler | |
{ | |
private $json = []; | |
public function __construct($json_file) | |
{ | |
try { | |
$json_file_content = file_get_contents($json_file); |
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
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { | |
var F = function () {}; | |
F.prototype = o; | |
return new F(); | |
}; | |
} |
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
#!/bin/sh | |
# | |
# Check whether there is a syntax error in the php files. | |
for file in `git diff --cached --name-only`;do | |
if [ "${file##*.}" = "php" ];then | |
output=`php -l $file` | |
if [ $? -gt 0 ];then | |
echo $output |
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 | |
/** | |
* git commit hook | |
* Check whether commit message include Chinese. If there is, stop the commit. | |
*/ | |
function cecho($string, $style = 'notice') { | |
if (isset($_SERVER['REQUEST_URI'])){ | |
echo $string, "\n"; | |
return; | |
} |
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 | |
/** | |
* Quick sort implementation. | |
* | |
* Keywords: pivot | |
*/ | |
class Quicksort | |
{ | |
/** | |
* Sort an array. |
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 | |
/** | |
* Merge Sort. | |
*/ | |
class MergeSort | |
{ | |
/** | |
* Let's sort it! | |
*/ | |
public function sort(array $aArray):array |