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
Object.defineProperty(Array.prototype, 'chunk', {value: function(n) { | |
return Array.from(Array(Math.ceil(this.length/n)), (_,i)=>this.slice(i*n,i*n+n)); | |
}}); | |
$(window).load(function(){ | |
$.each($('.hit-info a').toArray().chunk(4), function(index, els) { | |
var maxheight = 0; | |
$(els).each(function(){ | |
var height = $(this).outerHeight() | |
if(height > maxheight) { | |
maxheight = height; |
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 | |
$app->on('before.module', '*', function() use($app){ | |
$app->response->context['sites'] = array( | |
'title' => 'Сайты', | |
'link' => '', | |
'children' => array(), | |
); | |
$allsites = $app->cache->get('allsites'); | |
if (!$allsites){ |
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 | |
$app->on('after.module', 'pages/view/*', function() use($app){ | |
$parts = explode('/', $app->response->data['fullpath']); | |
$themes = str_replace(DIR_TEMPLATE, '', glob(DIR_TEMPLATE . '*', GLOB_ONLYDIR)); | |
if (in_array($parts[0], $themes)) { | |
$conf = $app->config_site; | |
$conf['template'] = $parts[0]; | |
$app->config_site = $conf; | |
} |
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).ready(function(){ | |
$('.stars').each(function(){ | |
var input = $(this), stars = $('<div class="stars-visible"><span></span><span></span><span></span><span></span><span></span></div>') | |
stars.find('span').click(function(){ | |
$(this).addClass('active').siblings().removeClass('active') | |
input.val(5-$(this).index()) | |
}) | |
input.hide().before(stars) | |
}) | |
}) |
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 | |
$this->response->script[] = 'https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.1/isotope.pkgd.min.js'; | |
?> | |
<div id="filters" class="button-group"> | |
<button class="button is-checked" data-filter="*">Все</button> | |
<?php foreach ($result['tags'] as $tag){ ?> | |
<button class="button" data-filter=".<?=convertToAscii($tag);?>"><?=$tag;?></button> | |
<?php } ?> | |
</div> |
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 nav_offset = $('nav').offset().top, | |
nav_height = $('nav').outerHeight(true); | |
$('nav').after($('<div>').addClass('padding').css('height', nav_height)); | |
$(window).scroll(function(){ | |
if ($(this).scrollTop() > nav_offset){ | |
$('nav').addClass('fixed') | |
} else { | |
$('nav').removeClass('fixed') | |
} | |
}); |
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 | |
$encoded = "..."; // <-- encoded string from the request | |
$decoded = ""; | |
for( $i = 0; $i < strlen($encoded); $i++ ) { | |
$b = ord($encoded[$i]); | |
$a = $b ^ 123; // <-- must be same number used to encode the character | |
$decoded .= chr($a) | |
} |
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
<HEAD><SCRIPT LANGUAGE="JavaScript"> | |
<!-- Begin | |
var WIDTH = 1; | |
var XA = 0; | |
var XB = 64; | |
var YA = 0; | |
var YB = 64; | |
var Z1 = 0; | |
var Z2 = 0; |
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
<HEAD><script> | |
<!-- Original: Darren Latham --> | |
<!-- Begin | |
function buildMaze(width, height) { | |
document.write("<html><style type=\"text/css\">.b { background:black;color:black} "); | |
document.write(".w { color:white;background:white }</style><body>"); | |
var error = 0; | |
if ( (parseInt(width) < 5) || (parseInt(height) > 20) ) { | |
document.write("<p>The width entered ("+width+") must be between 5 and 20. Hit back to try again.</p>"); |
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 | |
set_time_limit(0); | |
$file = dirname(__FILE__) . '/file.tgz'; | |
$url = 'http://site/file.tgz'; | |
$file_offset=filesize($file); | |
$file_offset=$file_offset-1024*4; |
OlderNewer