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
my @symbols_to_remove = Q:w「- _ ! , : / ( ) [ ] . ' + ? = * \ " # $ % & { } | ; ~ \ < > @ ` ^」; | |
my @terms_to_ignore = <for and the with from that your git bin this not svn who can you like into all more one any | |
over non them are very when about yet many its also most lets just>; | |
my &sanitize = *.trans(@symbols_to_remove => ' ').lc.words.grep( | |
{ .chars ≥ 3 and not /^ <[0..9]>+ $/ and /^ <[a..z] + [0..9]>+ $/ } | |
).grep(none @terms_to_ignore).unique; | |
say sanitize "The.quick 'brown' 🦊 jumps-OvER th 1337 QUICK <dog>!"; |
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
(defface my/awesome-tray-flymake-error | |
'((t (:foreground "#FF564A"))) | |
"Flymake error face." | |
:group 'awesome-tray) | |
(defface my/awesome-tray-flymake-warning | |
'((t (:foreground "#FF9800"))) | |
"Flymake warning face." | |
:group 'awesome-tray) | |
(defface my/awesome-tray-flymake-note | |
'((t (:foreground "#2196F3"))) |
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 raku | |
#| Manual wordle solver! | |
unit sub MAIN (Str :c(:$contains), Str :e(:$exclude), Str :a(:$at), Str :n(:$not-at)); | |
USAGE() and exit unless @*ARGS; | |
.put for '/usr/share/dict/words'.IO.lines.grep: { | |
.chars == 5 | |
and /^<:Ll>/ |
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 | |
connections=$(nmcli connection show | rg -v NAME) | |
selected_connection_line=$(echo "$connections" | rofi -dmenu -i -p 'Select connection: ') | |
rofi_exit_code=$? | |
selected_connection=$(echo "$selected_connection_line" | hck -d ' {2,}' -f 1) | |
# Disconnect on Alt-1 |
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 raku | |
sub infix:<.%>(&func, +@args) { | |
my $r = &func; | |
my $capture; | |
my $start = 0; | |
loop { | |
my $end = +@args; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
# Gets a filename and a file type, returns the files with the same type in the same directory | |
function find_files_by_type { | |
directory=$(dirname -- "$1") | |
items=$(fd . "$directory" --exact-depth 1 -t f -x file --mime-type '{}' | rg "$2" | perl -ne 's/:\s+.*$//; print' | sort -V) | |
echo "$items" | |
} |
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 | |
all_sinks=$(pactl list short sinks | cut -f 2) | |
default_sink=$(pactl info | grep 'Default Sink' | cut -d : -f 2) | |
active_sink=$(echo "$all_sinks" | grep -n $default_sink | cut -d : -f 1) | |
selected_sink=$(echo "$all_sinks" | rofi -dmenu -i -a $(($active_sink - 1)) -p 'Select a device: ') |
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 | |
windows=$(swaymsg -t get_tree | jq -r '.. | select(.type? and .type=="workspace") | {workspace: .name, node: recurse(.nodes[], .floating_nodes[])} | "[\(.workspace)]:" + if .node.focused then "*" else "" end + " \(.node.id): " + if .node.app_id then "\(.node.app_id)" elif .node.window then "\(.node.window_properties.class)" else empty end + ": \(.node.name)"') | |
active_window=$(echo "$windows" | grep -nE '^\[[[:alnum:]]+\]:\*' | cut -d : -f 1) | |
echo "$windows" | rofi -dmenu -a $(($active_window - 1)) -i -p 'Select window: ' | cut -d : -f 2 | xargs -I{} swaymsg '[con_id={}] focus' |
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
put 'Guess the number!'; | |
my Int:D $secret_number := (1..100).pick; | |
loop { | |
with +prompt "Please input your guess.\n" { | |
when UInt:D { | |
put "You guessed: $_"; | |
given $_ <=> $secret_number { |
NewerOlder