Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / Wayland.md
Last active July 28, 2024 18:23
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@NickHatBoecker
NickHatBoecker / eslint.sublime-completions
Created July 21, 2019 19:38
eslint autocomplete for Sublime Text 3
{
"completions":
[
{ "trigger": "eslint-disable-line\tDisable rule for this line", "contents": "// eslint-disable-line ${1:rule}" },
{ "trigger": "eslint-disable-next-line\tDisable rule for next line", "contents": "// eslint-disable-next-line ${1:rule}" },
]
}
@dmnsgn
dmnsgn / listAllEventListeners.js
Created April 5, 2017 15:40
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];
// Join together lists that don't have
// any blocks in-between
{
match: (node) => {
return node.kind == 'document'
},
validate: (document) => {
const joinableNode = document.nodes.find((node, key) => {
if (!['ordered-list', 'unordered-list'].includes(node.type)) { return false }
@goldo
goldo / lodash-assignIn-merge-defaults-diff.js
Last active December 14, 2023 00:49
Differences between .assignIn(), .assign, .merge(), defaults() and defaultsDeep()
// Tests with Lodash 4.16.4
// Thanks to http://stackoverflow.com/questions/19965844/lodash-difference-between-extend-assign-and-merge
_.assignIn ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.merge ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.defaults ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
_.defaultsDeep({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
---
@elclanrs
elclanrs / email-confirmation.php
Last active July 26, 2024 06:10
Simple e-mail confirmation plugin for WordPress.
<?php
/**
* Plugin Name: Email Confirmation
* Description: Send an email to the user with confirmation code and store form data in database until user confirms.
* Author: Cedric Ruiz
*/
class EmailConfirmation
{
const PREFIX = 'email-confirmation-';