Skip to content

Instantly share code, notes, and snippets.

@agragregra
agragregra / index.js
Last active May 13, 2023 13:20
Получить сумму всех выкупленных заказов DNS на вкладке "Выкупленные"
// Сначала необходимо долистать до конца страницы: Fn + ↓
total = 0;
$('.order-summary__sum').each(function() {
item = parseInt($(this).text().replace('₽', '').replace(' ', ''));
total += item;
});
console.log(total);
@agragregra
agragregra / migx-sample.js
Last active January 24, 2023 08:35
MIGX Sample
Tabs:
[
{"caption":"Tab Title", "fields": [
{"field":"title","caption":"Name"},
{"field":"description","caption":"Description","inputTVtype":"textarea"},
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"}
]}
]
Table:
@agragregra
agragregra / gulpfile.js
Created January 15, 2016 10:36 — forked from martinwolf/gulpfile.js
Jekyll, Browsersync and Gulp
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
@agragregra
agragregra / scroll-top.html
Last active December 25, 2022 19:51
Scroll Top Button
<div class="top" title="Наверх"><i class="fa fa-angle-double-up"></i></div>
.top
position: fixed
bottom: 25px
background-color: #E0E0E0
border-radius: 10em
color: #666
font-size: 26px
width: 50px
@agragregra
agragregra / modx_ace_material.txt
Last active December 6, 2022 18:15
MODx Ace Material Theme
MODx Ace Material Theme
1. Системные настройки > Пространство имен "ace":
Размер шрифта: 13px
Высота области редактирования: 560
Невидимые символы: Да
Мягкая табуляция: Нет
Размер табуляции: 2
Тема редактора: tomorrow_night
@agragregra
agragregra / gist:7ae9c76e895b3bacd944
Last active December 4, 2022 16:43
Sublime Text My Settings
// Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
// Settings:
{
"auto_complete": false,
"bold_folder_labels": true,
"close_windows_when_empty": false,
@agragregra
agragregra / window-resize-end.js
Last active October 3, 2022 19:29
Window resize-end function
//Resize Window
function onResize() {
};
var doit;
doit = setTimeout(onResize, 400);
window.onresize = function() {
clearTimeout(doit);
doit = setTimeout(onResize, 400);
};
@agragregra
agragregra / lazyload.js
Created February 13, 2020 07:53
Lazy loading img & background images using intersection observer
// Lazy loading img & background images using intersection observer
// Reference: https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/
// Using example: <img class="lazy" src="thumb.gif" data-src="real-img.jpg" data-srcset="real-img@1x.jpg 1x, real-img@2x.jpg 2x">
// Background image class usign example: <div class="lazy-background"> with added class ".visible" for styling
// Background image style attribute lazy loading example: <div data-bg="image.jpg">
// delete window.IntersectionObserver; // Fallback Testing
document.addEventListener('DOMContentLoaded', function() {
@agragregra
agragregra / hash-change.js
Last active October 3, 2022 19:21
CSS Target Without Jumping | Hash Change Without Jump
// Original
var hashLinks = document.querySelectorAll("a[href^='#']");
[].forEach.call(hashLinks, function (link) {
link.addEventListener("click", function (event) {
event.preventDefault();
history.pushState({}, "", link.href);
history.pushState({}, "", link.href);
history.back();
});
});
@agragregra
agragregra / media.css
Created December 15, 2015 11:50
Bootstrap Media CSS | Sass
/*========== Desktop First Method ==========*/
/* Large Devices, Wide Screens */
@media only screen and (max-width : 1200px) {
}
/* Medium Devices, Desktops */
@media only screen and (max-width : 992px) {