Skip to content

Instantly share code, notes, and snippets.

View pafnuty's full-sized avatar
⚒️
No time for commit, just push!

Pavel Belousov pafnuty

⚒️
No time for commit, just push!
View GitHub Profile
@Big-Shark
Big-Shark / DecimalFraction.php
Last active August 29, 2015 14:22
Сложение десятичных дробей
<?php
class DecimalFraction
{
public $numerator;
public $denominator;
public $integer = 0;
public function __construct($numerator, $denominator, $integer = null)
{
if( is_null($integer) )
<!-- HTML advanced commentary block -->
<snippet>
<content><![CDATA[
<${1:div} class="${2:col}">
${3:Content}
</${1:div}> <!-- .${2:col} -->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>`hac</tabTrigger>
</snippet>
@xamedow
xamedow / .gitconfig
Last active October 22, 2015 11:19
local git configuration file
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xamedow (Andrey Hamedov)
email = xamedow@gmail.com
[core]
editor = subl
[color "branch"]
current = yellow reverse
local = yellow
<?php
/*
=============================================================================
BlockPro 3 - Модуль для вывода блоков с новостями на страницах сайта DLE (тестировался на 9.7 и 9.8)
=============================================================================
Автор модуля: ПафНутиЙ
URL: http://blockpro.ru/
ICQ: 817233
email: pafnuty10@gmail.com
=============================================================================
@n0wheremany
n0wheremany / stopforumspam.php
Created February 20, 2013 17:45
DLE Выявление спамеров по базе пользователей
<?php
/*
=====================================================
n0wheremany
-----------------------------------------------------
http://nowheredev.ru/
-----------------------------------------------------
Copyright (c) 2013 n0wheremany
=====================================================
Данный код защищен авторскими правами

Работа с компонентом codenails:custom.form

В гисте план правильного создания формы и моменты, на которых спотыкаются незнакомые с компонентом разработчики

План-чеклист

  1. Продумываем список полей формы
  2. Создаем инфоблок для сохранения результатов и запоминаем коды свойств
  3. Создаем почтовое событие
  4. Создаем почтовый шаблон для события
  5. Настраиваем вызов компонента формы
  6. Настраиваем .config шаблона компонента формы
1. Склонировать https://github.com/may-cat/maycat.d7dull в папку /local/modules
git clone https://github.com/may-cat/maycat.d7dull.git
2. Заменить названия во всех файлах с учётом регистра
maycat -> ваш ник, разрешены ТОЛЬКО латинские буквы
d7dull -> название модуля
Для этого нужно пройтись контекстным поиском по всей папке и внести изменения + переименовать файл в папке admin в соответствии с названияем модуля
3. Продумать структуру классов и завести их в папке lib/ (подробнее о приёмах организации структуры - смотри видео)
@drublic
drublic / keep-focus.js
Last active March 29, 2017 15:20
A function that lets you circularly tab through a part of a page.
var tabbableElements = 'a[href], area[href], input:not([disabled]),' +
'select:not([disabled]), textarea:not([disabled]),' +
'button:not([disabled]), iframe, object, embed, *[tabindex],' +
'*[contenteditable]';
var keepFocus = function (context) {
var allTabbableElements = context.querySelectorAll(tabbableElements);
var firstTabbableElement = allTabbableElements[0];
var lastTabbableElement = allTabbableElements[allTabbableElements.length - 1];
@branneman
branneman / svg-classes.js
Created January 15, 2014 14:12
SVG — hasClass, addClass, removeClass, toggleClass
//
// SVG — hasClass, addClass, removeClass, toggleClass
// Source:
// https://gist.github.com/branneman/8436956
// Taken and adapted from:
// http://toddmotto.com/hacking-svg-traversing-with-ease-addclass-removeclass-toggleclass-functions/
//
if (SVGElement && SVGElement.prototype) {
<!--
In Vue, we use v-model for all form bindings, while
Knockout maintains separate binding types, such as
textInput, checked, and options. In some cases,
such as for an input of type "range", Knockout
simply doesn't have an equivalent two-way binding
helper and the more verbose value and valueUpdate
must be used.
-->
<div id="app">