$text = "any text site1.ru site2.com mysite.ru";
$excludeSites = [ "mysite.ru" ];
foreach( $excludeSites as $siteID => $siteName )
{
$text = str_replace( $siteName, "{{SITE_ID_" . $siteID . "}}", $text );
}
$newText = preg_replace('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@', '***', $text);
foreach( $excludeSites as $siteID => $siteName )
{
$newText = str_replace( "{{SITE_ID_" . $siteID . "}}", $siteName, $newText );
}
echo $newText;
var someFn = function()
{
console.log( (new Date) );
};
var i = 0;
var max = 10;
var _interval = setInterval(function() {
if( i < max )
{
someFn();
i++;
} else {
clearInterval( _interval );
}
}, 1000);
//redux-app/actions/LoadObject
export function LoadObject({ id }) {
return async ( dispatch, getState ) => {
let objectExist = getState().objects.some( _object => _object.id === id )
if( objectExist )
{
dispatch({
type: LOAD_OBJECT,
payload: {
id,
object: objectExist
}
})
} else {
dispatch({ type: LOAD_OBJECT_BEGIN })
let object = await ObjectApi.Load({ id })
dispatch({
type: LOAD_OBJECT,
payload: {
id,
object
}
})
}
}
}
ConsoleApi.PROCESS_INFORMATION _p = ConsoleApi.createConsoleTerminal(command);
Thread.Sleep(1000);
bool resultFree = ConsoleApi.FreeConsole();
if (resultFree)
{
Debug.WriteLine("FreeConsole: {0}", true);
}
else
{
Debug.WriteLine("FreeConsole: {0}", false);
}
Debug.WriteLine("Process ID: {0}", _p.dwProcessId);
bool result = ConsoleApi.AttachConsole(_p.dwProcessId);
Debug.WriteLine("AttachConsole: {0}", result);
IntPtr _consoleH = ConsoleApi.GetStdHandle(ConsoleApi.STD_OUTPUT_HANDLE);
ConsoleApi.CONSOLE_SCREEN_BUFFER_INFO _bufferInfo;
bool getInfo = ConsoleApi.GetConsoleScreenBufferInfo(_consoleH, out _bufferInfo);
if (getInfo)
{
Debug.WriteLine("GetConsoleScreenBufferInfo: {0}x{1}", _bufferInfo.dwSize.X, _bufferInfo.dwSize.Y);
}
else
{
Debug.WriteLine("GetConsoleScreenBufferInfo: {0}", false);
}
while(true)
{
IEnumerable<string> rows = ConsoleApi.ReadFromBuffer(_consoleH, 0, 0, _bufferInfo.dwSize.X, _bufferInfo.dwSize.Y);
foreach (string row in rows)
{
Debug.WriteLine(row);
}
Thread.Sleep(1000);
}
<pre id="output">
</pre>
var minRange = 123;
var maxRange = 12345;
var linkList = [];
for (var i = minRange ; i <= maxRange ; i++) {
linkList.push( 'http://download-files43.ru/fileid=' + i + '&uploadid=' + i );
};
document.querySelector('#output').innerHTML = linkList.join( "\n" );
.img{ background-size: cover; width: 100%; }
<div class="img" data-type="responsive-img" data-src="http://rara-rara.ru/pic/8b34f528e82489cd981bf2d8064f8c56.jpg" data-ratio="1.252" data-ratio-720="2.5">
var _fnResize = function()
{
$( '[data-type="responsive-img"]' ).each(function(){
var _img = $( this );
if( !_img.data( 'load' ) )
{
_img.css({ 'background-image': 'url(' + _img.data('src') + ')' });
_img.data( 'load' , true );
}
var _ratio = _img.data( 'ratio' );
if( window.innerWidth <= 720 ) _ratio = _img.data( 'ratio-720' );
_img.css({
height: _img.width() / _ratio
});
});
}
$( document ).ready( _fnResize );
$( window ).on( 'resize', _fnResize );