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
@remy
remy / details.js
Created April 18, 2010 22:28
Add <details> support - includes stylesheet
/**
* Note that this script is intended to be included at the *end* of the document, before </body>
*/
(function (window, document) {
if ('open' in document.createElement('details')) return;
// made global by myself to be reused elsewhere
var addEvent = (function () {
if (document.addEventListener) {
return function (el, type, fn) {
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox
<?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
=====================================================
Данный код защищен авторскими правами
@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) {
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
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/ (подробнее о приёмах организации структуры - смотри видео)
@mandiwise
mandiwise / Update remote repo
Last active April 17, 2024 07:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@may-cat
may-cat / 1 Пример с репозиториями организаций на гитхабе
Last active August 10, 2022 06:30
Примеры composer.json под Битрикс. Показывают, как подключать модули с помощью композера.
{
"name": "yourcompany/myproject",
"description": "Какой-то проект нашей компании",
"keywords": ["bitrix", "проектище"],
"homepage": "http://bitrix.expert/",
"type": "project",
"license": "Commerce",
"support": {
"source": "http://github.com/bitrix-expert/"
},