Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimir Panteleev CyberShadow

View GitHub Profile
View test.d
import std.math;
import ae.net.asockets;
import ae.sys.timing;
import mylib.linux.input_event_codes;
import uinput_filter.client;
import uinput_filter.common;
@CyberShadow
CyberShadow / test.d
Created Nov 26, 2020
Some attempts at rendering a wallpaper
View test.d
import ae.utils.graphics.color;
import ae.utils.graphics.hls;
import ae.utils.graphics.image;
import ae.utils.math;
import std.conv;
import std.math;
import std.stdio;
enum size = 4096;
View autosave.lua
-- autosave.lua
--
-- Periodically saves "watch later" data during playback, rather than only saving on quit.
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.).
--
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory.
-- Inside the "lua-settings" directory, create a file named "autosave.conf".
-- The save period can be set like so:
--
-- save_period=60
@CyberShadow
CyberShadow / .perltidyrc
Last active Jun 24, 2020
Bugzilla Harmony unstable branch reformat rewrite
View .perltidyrc
-pbp # Start with Perl Best Practices
-w # Show all warnings
-iob # Ignore old breakpoints
-l=80 # 80 characters per line
-vmll
-ibc
-iscl
-hsc
-mbl=2 # No more than 2 blank lines
-i=2 # Indentation is 2 columns
@CyberShadow
CyberShadow / .gitignore
Created Jun 17, 2020
Tombs & Tentacles
View .gitignore
/twine_graph
/graph.dot
/graph.dot.svg
View .gitignore
/crack_caesar
/crack_1to1_dict
/decode
/crack_alg_dict
/crack_vignette_dict
View ShellPatternsToRegex.bash
#!/bin/bash
# shellcheck disable=SC1003
set -eEuo pipefail
# Converts a list of wildcard patterns, as defined by glob(7) and used
# by e.g. GNU find for the -path switch, to a single regular
# expression.
function ShellPatternsToRegex() {
local patterns=("$@")
@CyberShadow
CyberShadow / dummy.txt
Created Feb 8, 2020
Subnautica input helper
@CyberShadow
CyberShadow / .gitignore
Created Feb 8, 2020
Subnautica map helper
View .gitignore
/draw
/map.svg
/map.txt
@CyberShadow
CyberShadow / btrfs-rescrub-errors
Last active Dec 4, 2019
btrfs-rescrub-errors
View btrfs-rescrub-errors
#!/bin/bash
# Scan dmesg for btrfs error messages, and re-scrub the respective
# offsets. Needs btrfs scrub with -s / -e switches:
# https://patchwork.kernel.org/patch/11268681/
set -eEuo pipefail
shopt -s lastpipe
blocksize=$((1*1024*1024*1024))