Skip to content

Instantly share code, notes, and snippets.

function midiNoteToFrequency(note) {
return Math.pow(2, (note - 69) / 12) * 440;
}
@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);
}
});
@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)) {
.responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
}
$(document).on('af_complete', function(event,res) {
if(res.success) $('.fancybox-close-small').click();
});
@eivko
eivko / javascript.redirect.js
Created September 8, 2018 05:32
javascript.redirect.js
<script> window.location.replace('https://eivko.ru'); </script>
[[*img:phpthumbon=`w=800&h=600&zc=1&fltr[]=wmi|logo1.png|C|40|20%|20%|0`]]
@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
@eivko
eivko / pdomenu.bootstrap.modx
Created October 17, 2017 05:56
pdomenu.bootstrap.modx
[[pdoMenu?
&level=`2`
&parents=`0`
&outerClass=`nav navbar-nav`
&tplOuter=`@INLINE <ul [[+classes]] id="menu">[[+wrapper]]</ul>`
&tplInner=`@INLINE <ul class="dropdown-menu">[[+wrapper]]</ul>`
&tplParentRow=`@INLINE <li [[+classes]]>
<a class="dropdown-toggle" data-toggle="dropdown" href="[[+link]]" [[+attributes]]>
[[+menutitle]]<span class="caret"></span>
</a>
@eivko
eivko / seo.meta.head.modx.html
Last active September 21, 2017 09:30
modx meta seo
<title>[[*longtitle:default=`[[*pagetitle]]`]]</title>
<meta name="description" content="[[*description]]">
<meta name="keywords" content="[[*keywords]]">