Skip to content

Instantly share code, notes, and snippets.

View SkyyySi's full-sized avatar

SkyyySi

View GitHub Profile
local lfs = require("lfs")
local _M = {}
function _M.list_child_files(directory_path)
local function get_full_child_paths(child_name)
if (child_name == ".") or (child_name == "..") then
return {}
end

UI-less Firefox

This is a short guide on how to set up a Firefox profile with no UI (no tabs, no address-bar, no bookmarks, etc.). Note that it is written for and only tested on Arch Linux. You'll probably need to perform different steps on Windows.

  1. Create a new Firefox profile
    1. Run this shell command:

firefox --no-remote --profilemanager

#!/usr/bin/env lua
local type = type
local print = print
local pcall = pcall
local select = select
local string = string
local io = io
local string_format = string.format
@SkyyySi
SkyyySi / ihk-fixes.user.styl
Last active January 6, 2025 16:02
Ein UserCSS / UserStyle, um die Webseite der Niederrheinischen IHK zumindest ein bisschen weniger fürchterlich zu machen.
/* ==UserStyle==
@name IHK Azubiheft Fix
@namespace github.com/SkyyySi
@version 1.0.0
@description Ein UserCSS / UserStyle, um die Webseite der Niederrheinischen IHK zumindest ein bisschen weniger fürchterlich zu machen.
@author SkyyySi
@preprocessor stylus
==/UserStyle== */
$header_padding = 1em

Microsoft Management Console (mmc)

Syntax

For starting a Snap-In from CMD, stored in an arbitrary directoy:

C:\> "%windir%\System32\mmc.exe" "<path>\<filename>.msc"
local getmetatable = getmetatable
local type = type
local assert = assert
local rawget = rawget
---@class private
local _M = {}
--- A helper function to check whether the type of a given parameter is correct,
--- generating an error message if it is not.
@SkyyySi
SkyyySi / gtk.css
Created October 22, 2023 17:58
Dracula for GTK4 / libadwaita applications
/*
Generated with Gradience
Issues caused by theming should be reported to Gradience repository, and not to upstream
https://github.com/GradienceTeam/Gradience
*/
@define-color accent_color #bd93f9;
@define-color accent_bg_color #bd93f9;
@SkyyySi
SkyyySi / get-battery.lua
Last active October 18, 2023 16:43
A standalone script to get the current charging percentage of your device's battery, written in Lua. Requires LGI. Linux only (maybe BSD too; probably not, though).
#!/usr/bin/env luajit
local script_version = "1.1.1"
local lgi = require("lgi")
local GLib = lgi.GLib
local UPowerGlib = lgi.UPowerGlib
local function get_battery()
for _, device in pairs(UPowerGlib.Client():get_devices()) do
@SkyyySi
SkyyySi / rc.moon
Last active February 8, 2023 22:06
Port of awesome wm's rc.lua to moonscript
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall require, "luarocks.loader"
awesome = awesome ---@type awesome
screen = screen ---@type screen
client = client ---@type client
awful = require "awful" ---@type awful
gears = require "gears" ---@type gears
@SkyyySi
SkyyySi / button.lua
Created January 26, 2023 16:50
A wibox.container for turning any widget into a button. For awesomewm.
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
---@class wibox.container.button : wibox.container.background
---@operator call(table): wibox.container.button._instance
---@field private _private table
local button = {}
button.mt = {}
setmetatable(button, button.mt)