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
document.body.innerHTML.match(/((8|\+7)?[\- ]?)?(\(?\d{3,4}\)?[\- ]?)?[\d\- ]{4,8}[\d]{2}/g) |
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
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; | |
header("location:{$protocol}://_:_@{$_SERVER['SERVER_NAME']}"); |
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
echo '<pre>'; | |
echo '<small>' . __FILE__ . "</small>\n"; | |
print_r($VAR$); | |
echo '</pre>'; |
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
$str = preg_replace( "#\s*?\r?\n\s*?(?=\r\n|\n)#s" , "" , $str ); |
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
/** | |
* "Подсветка" найденного кода в тексте | |
* | |
* @param string $str | |
* @param string $search | |
* | |
* @return string | |
*/ | |
function highlightFound($str, $search='') | |
{ |
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(){ | |
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; | |
s1.async=true; | |
var scheme = (document.location.href.indexOf('https://') === 0) ? 'https://' : 'http://'; | |
s1.src = scheme + 'example.com/example.js'; | |
s1.charset="UTF-8"; | |
//s1.crossorigin="anonymous"; | |
s0.parentNode.insertBefore(s1,s0); | |
})(); |
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(){ | |
var fileref=document.createElement("link") | |
fileref.setAttribute("rel", "stylesheet") | |
fileref.setAttribute("type", "text/css") | |
var scheme = (document.location.href.indexOf('https://') === 0) ? 'https://' : 'http://'; | |
fileref.setAttribute("href", scheme + 'example.com/example.css') | |
document.getElementsByTagName("head")[0].appendChild(fileref) | |
})(); |
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
public function indexAction() { | |
//... | |
$view = new ViewModel(array( | |
//... | |
)); | |
$view->setTerminal(true); | |
return $view; | |
} |
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 oldFetch = fetch; // must be on the global scope | |
fetch = function(url, options) { | |
var promise = oldFetch(url, options); | |
//todo: action | |
console.log(url); | |
return promise; | |
} |
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 httpRequest(url, method, data, success_callback, failure_callback) { | |
var xhr; | |
var data2 = []; | |
if (typeof data == 'object') { | |
for(var index in data) { | |
if (data.hasOwnProperty(index)) { | |
data2[data2.length] =index+'='+data[index]; | |
} | |
} |
OlderNewer