Skip to content

Instantly share code, notes, and snippets.

Anton Cherepov iron-cherep

Block or report user

Report or block iron-cherep

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
View php-unserialize_utf8_fix.php
<?php
/**
* Mulit-byte Unserialize (http://stackoverflow.com/questions/2853454/php-unserialize-fails-with-non-encoded-characters)
*
* UTF-8 will screw up a serialized string
*
* @access private
* @param string
* @return string
*/
View Overriding Material UI styles with Styled Components
For example, to override the AppBar (https://material-ui-next.com/api/app-bar/) root class we can do the following:
First method (override Material UI classnames):
1 - Add the property classes in the AppBar component:
<AppBar classes={{root: 'my-root-class'}}
2 - Override the styles with the styled components:
styled(AppBar)`
&.my-root-class {
z-index: 1500;
}
@iron-cherep
iron-cherep / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent
View multiple-deploy-keys-multiple-private-repos-github-ssh-config.md

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers. You want to perform git pull origin master for example, and you want this to happen without asking for a password.

@iron-cherep
iron-cherep / .parameters.php
Last active Jan 25, 2018
bitrix-компонент для получения элементов инфоблока в меню
View .parameters.php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
if(!CModule::IncludeModule("iblock"))
return;
$arTypesEx = CIBlockParameters::GetIBlockTypes(Array("all"=>" "));
$arIBlocks=Array();
$db_iblock = CIBlock::GetList(Array("SORT"=>"ASC"), Array("SITE_ID"=>$_REQUEST["site"], "TYPE" => ($arCurrentValues["IBLOCK_TYPE"]!="all"?$arCurrentValues["IBLOCK_TYPE"]:"")));
while($arRes = $db_iblock->Fetch())
@iron-cherep
iron-cherep / wc_dropdown_variation_attribute_options
Created Dec 6, 2017
модифицированный метод woocommerce для обработки имён атрибутов cyr2lat
View wc_dropdown_variation_attribute_options
if ( ! function_exists( 'wc_dropdown_variation_attribute_options' ) ) {
/**
* Output a list of variation attributes for use in the cart forms.
*
* @param array $args
* @since 2.4.0
*/
function wc_dropdown_variation_attribute_options( $args = array() ) {
$args = wp_parse_args( apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), array(
@iron-cherep
iron-cherep / rAF.js
Created Nov 20, 2017 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
View rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@iron-cherep
iron-cherep / goals.js
Last active Mar 31, 2019
js для добавления целей яндекс-метрики
View goals.js
/**
* Модуль для множественного добавления целей яндекс-метрики
*
* @param <string> counterId - идентификатор счётчика
* @param <array> goals - массив целей со структурой:
*
* [
* {
* element: DOM-node или node-list,
* event: событие,
@iron-cherep
iron-cherep / .htaccess
Last active Nov 15, 2017
https 301 redirect
View .htaccess
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@iron-cherep
iron-cherep / xdebug-php.md
Created Nov 8, 2017 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2017
View xdebug-php.md

🐞 Install and Configure xDebug on Ubuntu/Mac and PhpStorm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
View gradient-underline.scss
@mixin underline($color: $blue, $weight: 10px, $offset: 2px) {
background-image: linear-gradient(to top, transparent, transparent $offset, $color $offset, $color ($offset + $weight), transparent ($offset + $weight));
}
You can’t perform that action at this time.