Skip to content

Instantly share code, notes, and snippets.

@eivko
eivko / Bootstrap3_hover.js
Created October 17, 2017 05:59
onclick.pdomenu.bootstrap.modx
/**
* Project: Bootstrap Hover Dropdown
* Author: Cameron Spear
* Contributors: Mattia Larentis
*
* Dependencies: Bootstrap's Dropdown plugin, jQuery
*
* A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
*
* License: MIT
[[*img:phpthumbon=`w=800&h=600&zc=1&fltr[]=wmi|logo1.png|C|40|20%|20%|0`]]
@eivko
eivko / javascript.redirect.js
Created September 8, 2018 05:32
javascript.redirect.js
<script> window.location.replace('https://eivko.ru'); </script>
$(document).on('af_complete', function(event,res) {
if(res.success) $('.fancybox-close-small').click();
});
.responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
}
@eivko
eivko / adduser.php
Created July 6, 2020 10:53
Создание Super User-а для MODX
<?php
$username = 'vasya';
$password = 'qwerty';
$email = '[email protected]';
$sudo = true;
require 'config.core.php';
require MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
if ((!$modx) || (!$modx instanceof modX)) {
@eivko
eivko / scrollTo.js
Created August 11, 2020 11:38
Scroll to the selected anchor
$('a[href^="#"]').on('click', function(event) {
var target = $(this.getAttribute('href'));
if( target.length ) {
event.preventDefault();
$('html, body').stop().animate({
scrollTop: target.offset().top
}, 1000);
}
});
function midiNoteToFrequency(note) {
return Math.pow(2, (note - 69) / 12) * 440;
}