This file contains hidden or 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 | |
curl https://en.wikipedia.org/w/api.php -F format=json -F action=parse -F contentmodel=wikitext -F text='<-' 2> /dev/null | jq -r '.parse.text["*"]' |
This file contains hidden or 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 luaversion = function() | |
if ({false, [1] = true})[1] then -- luacheck: ignore 314 | |
return 'LuaJIT' | |
elseif 1 / 0 == 1 / '-0' then | |
return 0 + '0' .. '' == '0' and 'Lua 5.4' or 'Lua 5.3' | |
end | |
local f = function() return function() end end | |
return f() == f() and 'Lua 5.2' or 'Lua 5.1' | |
end |
This file contains hidden or 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 \ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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') |