Skip to content

Instantly share code, notes, and snippets.

Wubba lubba dub dub!

Ivan Martianov ivansky

Wubba lubba dub dub!
  • Emergn
  • Russia
Block or report user

Report or block ivansky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ivansky / example.jsx
Created Apr 26, 2019
React how to attach scroll event and measure DOM elements
View example.jsx
import throttle from 'lodash/throttle';
class Component {
someSectionRef = null;
componentDidMount() {
// check window object existing, to not listen events in SSR
if(window) {
window.addEventListener('scroll', this.onScroll);
View blockOverscroll.ts
type ScrollDirection = 'vertical' | 'horizontal' | 'both';
* It prevents default behaviour above the scrollable areas
* until it's in available scrollable direction.
* Example of checkScrollableElement:
* var cleanBlocking = (
* blockOverScroll(
ivansky / YADWord.php
Created May 26, 2015
Yandex Wordstat Collector
View YADWord.php
class YADWord {
private static $bind_region = array();
private static $bind_crc = array();
public $region_id = 213;
public $original;
View search_keyword_prepare.php
* Remove from string all invalid characters
* Leave only English, Russian, Turkish, Kazakh and Numbers
* @link
* @param string $w
* @return string
function prepareSearchKeyword($w){
ivansky / .htaccess
Last active Feb 12, 2019
PHP 304 Last Modified Example
View .htaccess
# Bitrix Example
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
#RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
View gist:c3232bc9e6a7bcd90921
function test($str){
list($var) = explode('/', $str);
return $var;
function test2($str){
$var = array_shift(explode('/', $str));
return $var;
View cssrefresh_link.txt
View AutoLoader.php
class AutoLoader {
private static $possible = array();
private static $events = array();
public static function load($class){
View bitrix_body_class.php
function parseClasses($classes){
return explode(' ', preg_replace('/[\t\s]+/',' ', trim($classes)));
function addBodyClass($class){
$classes = parseClasses($APPLICATION->GetPageProperty('body_class'));
$add = parseClasses($class);
View get_variables_different_arrays.php
$source = [
'color' => ['red','blue','white','yellow','black'],
'who' => ['rabbit','bear','wolf'],
'else' => ['in space','in Russia','is hungry','is dead']
You can’t perform that action at this time.