This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
function launch --wraps exec | |
sh -c "(exec $(string escape $argv | string join ' ') >/dev/null 2>&1 &)" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
call_dbus() { | |
dbus-send \ | |
--print-reply=literal \ | |
--session \ | |
--dest=org.kde.KWin \ | |
/VirtualKeyboard \ | |
"$@" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
obj_to_yaml() can print an object to a Yaml-like string. | |
This is useful to inspect complex objects in a friendlier manner. | |
''' | |
from typing import Any | |
def is_non_printable(obj: Any) -> bool: | |
return hasattr(obj, '__dict__') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################# | |
## Description ## | |
################# | |
# This service script will allow you to select some files and folders and | |
# delete them permanently (bypassing the trash), with a confirmation prompt. | |
# | |
# To install the script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd "$HOME/.mozilla/firefox" | |
cd "$(ls -d *.default-release/ | head -n 1)" | |
jq \ | |
-r '.addons[] | select(.type == "extension" and .active == true and .hidden == false) | .defaultLocale.name' \ | |
extensions.json \ | |
| sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ $(id -u) > 0 ]] && echo 'Error: Needs to be run as root.' && exit 1 | |
reflector \ | |
--country 'Brazil,Canada,Chile,Colombia,Ecuador,Mexico,Paraguay,United States' \ | |
--fastest 10 \ | |
--protocol https \ | |
--sort rate \ | |
--threads $(nproc) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import pygame as pg | |
import enum | |
import math | |
import random | |
# Global game constants. | |
GAME_TITLE = "Pong" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <functional> | |
using namespace std::placeholders; | |
template<typename Signature> | |
struct Extension { | |
std::function<Signature> func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local wt = require("wezterm"); | |
local TabBackground = "#000" | |
local TabForeground = "#aaa" | |
local TabForegroundActive = "#fff" | |
function string.split(str, sep) | |
local t = {} | |
for s in string.gmatch(str, "([^"..sep.."]+)") do | |
table.insert(t, s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <future> | |
#include <chrono> | |
#include <thread> | |
using namespace std::literals; | |
static std::mutex println_mutex; | |
constexpr auto println = [](auto... stuff) { |
NewerOlder