Skip to content

Instantly share code, notes, and snippets.

View sergeymitr's full-sized avatar

Sergey Mitroshin sergeymitr

View GitHub Profile
@sergeymitr
sergeymitr / folding-ul.js
Created August 3, 2019 17:25
Folding UL list Web Component
class FoldingUL extends HTMLUListElement {
constructor() {
super();
const self = this;
document.addEventListener('DOMContentLoaded', () => {
self.init();
});
}
@sergeymitr
sergeymitr / connection-package-config.php
Last active January 29, 2021 22:45
Jetpack Config Architecture Proposal
<?php
/**
* Each package that requires initialization will have a configuration file like this.
* The Configuration should implement at least one configuration interface.
*/
namespace Automattic\Jetpack\Connection;
use Automattic\Config\OnPluginDeactivation;
use Automattic\Config\OnPluginsLoaded;
@sergeymitr
sergeymitr / jetpack-connection-ui.php
Last active November 19, 2021 17:03
Jetpack Connection UI Activator
<?php
/*
Plugin Name: Jetpack Connection UI Activator
Author: Automattic
Version: 0.2
*/
add_action( 'plugins_loaded', function() {
if ( class_exists( '\Automattic\Jetpack\ConnectionUI\Admin' ) ) {
\Automattic\Jetpack\ConnectionUI\Admin::init();
<?php
/**
* Plugin Name: Jetpack IDC customizer
* Description: Sample customizer of the Jetpack IDC screen.
* Version: 1.0
* Author: Automattic
* Author URI: https://automattic.com/
* Text Domain: jetpack
*
* @package automattic/jetpack
class TreeSet {
root = null;
insert(element, node = null) {
if (this.root === null) {
this.root = { val: element, left: null, right: null };
return true;
}
if (node === null) {
@sergeymitr
sergeymitr / jetpack-multi-domain-idc.php
Created August 23, 2022 15:43
Multi-domain support for Jetpack IDC
<?php
/*
Plugin Name: Jetpack IDC Multi-Domain
Author: Automattic
Version: 0.1
*/
add_filter( 'jetpack_sync_home_url', function() {
return 'https://example.org';
} );