Skip to content

Instantly share code, notes, and snippets.

Hi-Angel / foo.el
Last active December 25, 2021 14:42
Functions needed for Emacs to check multiple languages simultaneously. Tested under `emacs -Q` as of 28.0.50 version. Make sure to have the hunspell dictionaries!
View foo.el
(require 'ispell)
(setq ispell-program-name "hunspell")
(ispell-hunspell-add-multi-dic "ru_RU,en_US")
(ispell-change-dictionary "ru_RU,en_US" t)
(flyspell-mode 1)
Hi-Angel /
Last active January 20, 2021 21:39
A script to package built libinput as a deb.
# NOTE: make sure the libinput build is configured with --prefix=/usr/. It is
# important, so libraries upon installation end up in correct locations.
set -e
if [ "$#" -ne 1 ]; then
echo "Wrong number of parameters.
Usage: $(basename $0) build_dir"
exit 1
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
formats = '\n'.join([str(x) for x in clipboard.wait_for_targets()[1]])
print("Current clipboard offers formats: " + formats)
Hi-Angel / github-pandoc.css
Created April 30, 2020 13:07 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
View github-pandoc.css
/*! normalize.css v2.1.3 | MIT License | */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
* Correct `block` display not defined in IE 8/9.
Hi-Angel / disable-touchpad-pm.service
Created April 28, 2020 16:11
View disable-touchpad-pm.service
# disables Acer aspire v3 572g touchpad PM to work around input delays
ExecStart=sh -c "echo on > /sys/bus/i2c/devices/i2c-0/device/power/control"
View clock_gettime_override.cpp
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
extern "C"
int clock_gettime(clockid_t clk_id, struct timespec *tp) {
using clock_gettime_ptr = int (*)(clockid_t, struct timespec*);
const static clock_gettime_ptr real_clock_gettime
= (clock_gettime_ptr) dlsym(RTLD_NEXT, "clock_gettime");
Hi-Angel / noop.hpp
Last active January 3, 2019 15:37
noop protocol client-header generated
View noop.hpp
/* Generated by wayland-scanner 1.16.0 */
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
Hi-Angel /
Created October 1, 2017 12:23
a python UNO code I used to format my student papers.
import uno
import os
# that's like a consts, but they isn't since consts not allowed in python 😝
HEADING1 = "Heading 1"
HEADING2 = "Heading 2"
HEADING5 = "Heading 5" #appendinx
STYLESFILE = "./styles.odt"
PAGE_BEFORE = 4 #that is from enumeration — that awful API have problems with them
Hi-Angel / 50-udiskie.rules
Last active May 18, 2020 20:22
Make polkit allow mounting by user in "storage" group
View 50-udiskie.rules
// Tested with ArchLinux. Cures dolphin/nautilus error "Not authorized to perform action" upon mounting.
// Sources: and
// 1. make sure you are in "storage" group
// 2. create /etc/polkit-1/rules.d/50-udiskie.rules file with the following content
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
// NOTE: there must be a comma at the end of each line except for the last:
var permission = {
// required for udisks1:
// "org.freedesktop.udisks.filesystem-mount": YES,