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
var input = $("#control"); | |
function something_happens() { | |
input.replaceWith(input.val('').clone(true)); | |
}; |
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 | |
if (isset($_POST) AND count($_POST)) { | |
ob_start(); | |
print_r($_POST); | |
$output = ob_get_clean(); | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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
EXPLAIN |
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
function filterPath(string) { | |
return string | |
.replace(/^\//,'') | |
.replace(/(index|default).[a-zA-Z]{3,4}$/,'') | |
.replace(/\/$/,''); | |
} | |
var locationPath = filterPath(location.pathname); | |
var scrollElem = scrollableElement('html', 'body'); |
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
[Xdebug] | |
zend_extension="%sprogdir%/modules/php/%phpdriver%/ext/php_xdebug.dll" | |
;xdebug.default_enable = 1 | |
xdebug.auto_trace = 0 | |
xdebug.collect_includes = 1 | |
;xdebug.collect_params = 4 | |
;xdebug.collect_return = 1 | |
;xdebug.collect_assignments = 1 | |
;xdebug.collect_vars = 1 | |
xdebug.dump.REQUEST = * |
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 | |
function big_rand($len = 9) | |
{ | |
$rand = ''; | |
while (!(isset($rand[$len - 1]))) { | |
$rand .= mt_rand(); | |
} | |
return substr($rand, 0, $len); | |
} |
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
INSERT INTO users_orders(user_id, order_id) SELECT users.id, orders.id FROM baget JOIN orders |
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
SELECT * FROM prod ORDER BY IF(img,1,0) DESC, price DESC; |
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
var $button = $('.js-filter-button'); | |
$button.on('click', function(event) { | |
event.preventDefault(); | |
var $this = $(this); | |
var $form = $this.closest('form'); | |
var emptyTextBoxes = $form.find('input:text, input:radio, input:checkbox, select').filter(function() { | |
return this.value == ""; | |
}); |
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
netstat -o -n -a | findstr :8080 # find process on port 8080 | |
taskkill /f /PID 666 # kill this process | |
taskkill /F /IM chrome.exe # kill all chrome processes |
OlderNewer