Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / Wayland.md
Last active March 29, 2024 15:49
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.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@peterldowns
peterldowns / Justfile
Last active March 29, 2024 15:48
Script to generate a Makefile wrapper for a Justfile, with examples.
# this setting will allow passing arguments through to tasks, see the docs here
# https://just.systems/man/en/chapter_24.html#positional-arguments
set positional-arguments
# print all available commands by default
default:
just --list
# run the test suite
test *args='./...':
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441 Video manual: https://www.youtube.com/watch?v=EPytrn8i8sc
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
@niftycode
niftycode / createPythonProject.sh
Last active March 29, 2024 15:45
Shell script to create a Python project
#!/bin/bash -
#===============================================================================
#
# FILE: createPythonProject.sh
#
# USAGE: ./createPythonProject.sh
#
# DESCRIPTION: Create a new Python project
#
# VERSION: 1.3
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active March 29, 2024 15:44
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@Delivator
Delivator / google_search_maps_addon.user.js
Last active March 29, 2024 15:39 — forked from Daan-Grashoff/google_search_maps_addon.js
Bring back the google maps button and make map image clickable when searching on google
// ==UserScript==
// @name Google Search Maps Fix
// @namespace http://tampermonkey.net/
// @version 2024-03-07
// @description Bring Google maps button back
// @author Daan Grashoff / Delivator
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@SavageCore
SavageCore / 1-readme.md
Last active March 29, 2024 15:38 — forked from cdleveille/Install⁄Update Xone
Install or update xone driver for Steam Deck (desktop shortcut and bash script)

Enjoying this script? Consider buying me a beer/coffee!

ko-fi

First time setting up your Deck? You may enjoy my setup guide. It'll get you started on Emulation.

Improvements

Main changes at initial release versus cdleveille's original script:

  • Added zenity for a basic "GUI"
@beatzxbt
beatzxbt / orderbook_testing.py
Created March 29, 2024 13:21
fast orderbook implementation in numpy/numba
import numpy as np
from time import perf_counter_ns
from numba import njit, int64, float64, bool_
from numba.experimental import jitclass
from scipy.stats import skewnorm
from numpy.typing import NDArray
@njit(bool_[:](float64[:], float64[:]), nogil=True)
def isin(a: NDArray, b: NDArray) -> NDArray:
out = np.empty(a.size, dtype=bool_)
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active March 29, 2024 15:36
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@steven2358
steven2358 / ffmpeg.md
Last active March 29, 2024 15:32
FFmpeg cheat sheet