Skip to content

Instantly share code, notes, and snippets.

View Rad1calDreamer's full-sized avatar

Andrei Kornev Rad1calDreamer

View GitHub Profile
@Rad1calDreamer
Rad1calDreamer / ultimate-ut-cheat-sheet.md
Created January 28, 2020 05:01 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@Rad1calDreamer
Rad1calDreamer / gist:6d81e010194c57f8e968
Created February 9, 2016 08:56
Git resolve conflicts
Check out, review, and merge locally
Step 1. Fetch and check out the branch for this merge request
git fetch origin
git checkout -b dev/bugfix/tags_ellipsis origin/dev/bugfix/tags_ellipsis
Step 2. Review the changes locally
Step 3. Merge the branch and fix any conflicts that come up
git checkout development
@Rad1calDreamer
Rad1calDreamer / gist:fe12e73fa6378c0e9230
Created December 21, 2015 12:59 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@Rad1calDreamer
Rad1calDreamer / style.css
Created September 28, 2015 07:01
Обрезание длинных слов на css
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@Rad1calDreamer
Rad1calDreamer / intro
Created May 6, 2015 12:18
msnetModal
Список стандартных форм и способы их обработки:
авторизация\регистрация\забыли пароль (компоненты)
добавить в корзину (функция)
информационные формы (html)
функции для обработки форм:
js -сбор данных, отправка, вывод ошибок
в качестве контролера используется ajax.php, в который мы отправляем запросы с определенным type. В ответ получаем json\text и выводим его в модальную форму.
@Rad1calDreamer
Rad1calDreamer / gist:b08bc00d14afc4cf66b5
Created April 6, 2015 07:19
Древовидный catalog.section.list
$arStructured = array();
$sectionLink = array();
$arStructured['ROOT'] = array();
$sectionLink[0] = &$arStructured['ROOT'];
foreach ($arResult['SECTIONS'] as $arSection) {
$sectionLink[intval($arSection['IBLOCK_SECTION_ID'])]['CHILD'][$arSection['ID']] = $arSection;
$sectionLink[$arSection['ID']] = &$sectionLink[intval($arSection['IBLOCK_SECTION_ID'])]['CHILD'][$arSection['ID']];
}
unset($sectionLink);
$arResult['_STRUCTURED_SECTIONS'] = $arStructured;
// Small screens
@media only screen { } /* Define mobile styles */
@media only screen and (max-width: 40em) { } /* max-width 640px, mobile-only styles, use when QAing mobile issues */
// Medium screens
@media only screen and (min-width: 40.063em) { } /* min-width 641px, medium screens */
@media only screen and (min-width: 40.063em) and (max-width: 64em) { } /* min-width 641px and max-width 1024px, use when QAing tablet-only issues */
@Rad1calDreamer
Rad1calDreamer / gist:075e6e942817fa520d0d
Created April 1, 2015 10:59
ProgressBar for flickity
add div.progressbar into slider's container
add option 'cellSelector'
and add some callbacks :
$gallery.on( 'cellSelect', function() {
var el = $('.progressbar');
var newone = el.clone(true);
el.before(newone);
$("." + el.attr("class") + ":last").remove();
@Rad1calDreamer
Rad1calDreamer / gulpfile.js
Last active May 16, 2022 13:03
Настройка и установка glup

Сборщик для студии «Медиасеть» --------------------------

Для обновления уже установленных плагинов скачиваем актулаьные gulpfiles.js и package.json и выплняем команду .. code:

npm update

Для установки скачиваем файл package.json в корень проекта