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
SELECT GROUP_CONCAT('kill ',id SEPARATOR '; ') AS kill_list | |
FROM INFORMATION_SCHEMA.PROCESSLIST | |
WHERE command='Sleep'; |
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
/** | |
* Mass (bulk) insert or update on duplicate for Laravel 4/5 | |
* | |
* insertOrUpdate([ | |
* ['id'=>1,'value'=>10], | |
* ['id'=>2,'value'=>60] | |
* ]); | |
* | |
* | |
* @param array $rows |
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 encrypt($data, $salt='!kQm*fF3pXe1Kbm%9') { | |
$key = hash('SHA256', $salt, true); | |
srand(); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); | |
if (strlen($iv_base64 = rtrim(base64_encode($iv), '=')) != 22){ | |
return false; | |
} | |
$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data . md5($data), MCRYPT_MODE_CBC, $iv)); | |
return $iv_base64 . $encrypted; | |
} |
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
$list = array( | |
"adjust", "anchor", "archive", | |
"area-chart", "arrows", "arrows-h", | |
"arrows-v", "asterisk", "at", | |
"automobile", "ban", "bank", | |
"bar-chart", "bar-chart-o", "barcode", | |
"bars", "bed", "beer", "bell", "bell-o", | |
"bell-slash", "bell-slash-o", "bicycle", | |
"binoculars", "birthday-cake", "bolt", | |
"bomb", "book", "bookmark", "bookmark-o", |
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
<select id="yy" name="yy"> | |
<option value="">--Year--</option> | |
<?php | |
$startYear = 1920; /*Start counting from the year 1920*/ | |
$endYear = date('Y'); /*End count in the current year*/ | |
foreach (range($startYear, $endYear) as $year) { | |
?> | |
<option value="<?php echo $year;?>"><?php echo $year;?></option> | |
<?php |