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 | |
### Constants | |
# the index of the first layout in the primary layer | |
PRIMARY_LAYER=0 | |
# the index of the first and only layout in the secondary layer | |
SECONDARY_LAYER=2 | |
### Functions |
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
from __future__ import annotations | |
import argparse | |
import json | |
import subprocess | |
from typing import Callable, Iterable, Iterator, TypedDict | |
class Workspace(TypedDict): | |
name: str |
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 sql = arg[1] | |
if not sql then | |
print(('usage: %s SQL'):format(arg[0])) | |
os.exit() | |
end | |
local ffi = require('ffiex') | |
local lib = ffi.load('sqlite3') |
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
http { | |
map $http_x_forwarded_proto=$http_x_forwarded_port $redirect_port { | |
http=80 ''; | |
https=443 ''; | |
default :$http_x_forwarded_port; | |
} | |
server { | |
listen 8080; |
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 bash | |
die() { | |
notify-send "${NOTIFICATION_SUMMARY}" "${1}" -i audio-volume-muted -t 3000 | |
exit 1 | |
} | |
config_path="${XDG_CONFIG_HOME:-$HOME/.config}/switch-sink.conf.bash" | |
[[ -f ${config_path} ]] || die 'Config not found' | |
# shellcheck disable=SC1090 |
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 | |
INTEGRATED='pci-0000_0c_00.4' | |
VIDEOCARD='pci-0000_0a_00.1' | |
TRAY_APP='volumeicon' | |
NOTIFICATION_SUMMARY='Audio Output' | |
die() { |
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
ARG python_version | |
FROM python:${python_version}-alpine AS base | |
FROM base AS builder | |
COPY requirements.txt /tmp/ | |
RUN pip install --target=/tmp/build --no-deps -r /tmp/requirements.txt | |
FROM base | |
ARG python_version | |
WORKDIR /opt/project/ |
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
/* @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); */ | |
/* hide the native tabs */ | |
#main-window:not([privatebrowsingmode]) #TabsToolbar { | |
visibility: collapse; | |
} | |
/* hide the sidebar header */ |
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 tcp_sock_mt = getmetatable(ngx.socket.tcp()) | |
local udp_sock_mt = getmetatable(ngx.socket.udp()) | |
local is_socket_object = function(obj) | |
local obj_mt = getmetatable(obj) | |
return obj_mt == tcp_sock_mt or obj_mt == udp_sock_mt | |
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/sh | |
ON='{"full_text": "", "color": "#00ff00"}' | |
OFF='{"full_text": "", "color": "#ff0000"}' | |
dbus-send --system \ | |
--print-reply \ | |
--dest=org.freedesktop.NetworkManager \ | |
/org/freedesktop/NetworkManager \ | |
org.freedesktop.DBus.Properties.Get \ |
NewerOlder