View LudwigsPickaxe.sh
# Ludwig's special pickaxe | |
# | |
# Inspired by: | |
# https://forums.skunity.com/threads/3x3-mining.4864/#post-18936 | |
# | |
# Install https://github.com/SkriptLang/Skript/releases | |
# Place this file in plugins/Skript/scripts | |
# | |
# Usage: | |
# /lp user <user> permission set lpickaxe.use true |
View listen.bash
#!/usr/bin/env bash | |
main() { | |
local first=$1 | |
local last=$2 | |
local pids=() | |
[[ -z "${first}" || -z "${last}" ]] && { >&2 echo "listen.sh <first> <last>"; return 1; } | |
for (( port=first; port <= last; port++ )); do |
View gist:8bc1761d10ac36388039cb3b798e7ab2
# After gathering all the evidence: | |
grep -f <(grep -f <(awk '/^License Plate L337.*9$/,/^$/' vehicles | sed '/^$/d' | paste -d, - - - - - - | awk '/Honda/ && /Blue/ && /Height: 6/' | awk -F, '{print $4}' | awk -F': ' '{print $NF}') memberships/{AAA,Delta_SkyMiles,Museum_of_Bash_History,Terminal_City_Library} | awk -F: '{print $NF}' | sort | uniq -c | awk '/ 4 / {print $2" "$3}') people | awk '{gsub(/,/, "", $6); print "nl streets/"$5"_"$6" | grep "$NF}' | bash | awk -F# '{print "grep -nH \"Considered a suspect\" interviews/interview-"$NF}' | bash | awk -F'[-:]' '{print "grep -n \"SEE INTERVIEW #"$2"\" streets/*"}' | bash | awk -F'[/:]' '{gsub(/_/, " ", $2); print "grep -E \""$2".*line "$3"\" people"}' | bash | awk '{print $1" "$2}' | $(command -v md5 || command -v md5sum) | grep -qif /dev/stdin ../encoded && echo CORRECT\! GREAT WORK, GUMSHOE. || echo SORRY, TRY AGAIN. |
View chartjs.background.plugin.ts
import { Easing, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js'; | |
export class BackgroundPlugin implements PluginServiceGlobalRegistration, PluginServiceRegistrationOptions { | |
id = 'background-plugin'; | |
beforeDraw(chartInstance: Chart, easing: Easing, options?: any): void { | |
const chartOptions = chartInstance.options as any; | |
if (!('backgroundPlugin' in chartOptions) || !('backgroundColors' in chartOptions.backgroundPlugin)) { | |
return; | |
} |
View bash
↳ cat curl-format.txt | |
{\n | |
"time_namelookup": %{time_namelookup},\n | |
"time_connect": %{time_connect},\n | |
"time_appconnect": %{time_appconnect},\n | |
"time_pretransfer": %{time_pretransfer},\n | |
"time_redirect": %{time_redirect},\n | |
"time_starttransfer": %{time_starttransfer},\n | |
"time_total": %{time_total}\n | |
}\n |
View pet-snippet.toml
[[snippets]] | |
description = "Get my external IP address." | |
command = "curl ifconfig.co" |
View measure-wireless.sh
#!/usr/bin/env bash | |
wifi_interface="$(nmcli d | awk '$2 ~ /wifi/ {print $1}')" | |
description="${1:-${wifi_interface}}" | |
sudo true | |
samples=10 | |
sequences=($(seq 1 ${samples})) |
View .screenrc
startup_message off | |
escape ^Ss | |
termcapinfo rxvt-unicode ti@:te@ #enable SHIFT-PGUP / SHIFT-PGDOWN scroll | |
terminfo rxvt-unicode ti@:te@: | |
term screen-256color | |
setenv LC_CTYPE en_US.UTF-8 | |
defutf8 on | |
nonblock on | |
vbell off | |
msgwait 10 |
View .bashrc
if [[ "${TERM}" == screen* ]]; then | |
preexec() { :; } | |
screen_window_title() { | |
[[ -n "${COMP_LINE}" ]] && return | |
[[ "${BASH_COMMAND}" == "${PROMPT_COMMAND}" ]] && return | |
local cmd=$(HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//") | |
local title="${cmd}" | |
(( "${#title}" > 12 )) && title="${title:0:12}..." | |
printf '\ek%s\e\\' "${title}" |
View test_unicode.sh
test_unicode() { | |
echo -ne "\xe2\x88\xb4\033[6n\033[1K\r" | |
# shellcheck disable=SC2034 | |
read -d R foo | |
echo -ne "\033[1K\r" | |
echo -e "${foo}" | cut -d \[ -f 2 | cut -d";" -f 2 | ( | |
read UNICODE | |
[[ $UNICODE -eq 2 ]] | |
) 2>/dev/null | |
} |
NewerOlder