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
def brute_search( arr, score, my_min, path): | |
if len(arr) == 0: | |
return score, path | |
if my_min is None: | |
take, take_path = brute_search( arr[1:], 1, arr[0], [(1, arr[0])] ) | |
ignore, ignore_path = brute_search( arr[1:], 0, None, []) | |
if take > ignore: | |
return take,take_path | |
else: |
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/bash | |
thumbnail(){ | |
wget -cq "https://i3.ytimg.com/vi/$1/hqdefault.jpg" -O ~/.scripts/resources/thumbnails/$1.jpg | |
# title=$(wget --quiet -O - "https://www.youtube.com/watch?v=$2" | paste -s -d " " | sed -e 's!.*<head>\(.*\)</head>.*!\1!' | sed -e 's!.*<title>\(.*\)</title>.*!\1!' | sed 's/\s*-\s*YouTube//') | |
} | |
viewer(){ | |
alacritty --class subtube_viewer -e youtube-viewer &> /dev/null & | |
} |
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
" ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗ | |
" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝ | |
" ██║ ██║██║██╔████╔██║██████╔╝██║ | |
" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║ | |
" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╗ | |
" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ | |
" Settings {{{ | |
syntax on | |
filetype indent on |
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/zsh | |
wid=$1 | |
class=$2 | |
instance=$3 | |
monitor=$4 | |
desktop=$5 | |
node=$6 | |
if [[ "$class" == "mpv" ]]; then |
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/zsh | |
wid=$1 | |
class=$2 | |
instance=$3 | |
monitor=$4 | |
desktop=$5 | |
node=$6 | |
if [[ "$class" == "mpv" ]]; then |
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/zsh | |
wid=$1 | |
class=$2 | |
instance=$3 | |
monitor=$4 | |
desktop=$5 | |
node=$6 | |
if [[ "$class" == "mpv" ]]; then |
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/bash | |
ICON="~/.scripts/resources/tmux.png" | |
if [[ $1 == 'kill' ]]; then | |
chosen=$(tmux ls | awk -F: '{print $1}' | rofi -theme "~/.config/rofi/tmux_warning.rasi" -dmenu -i -p 'Kill tmux session') | |
[[ ! -z $chosen ]] && notify-send -i $ICON -t 2000 "Tmux session killed" && alacritty --class toggle_tmux -e tmux kill-session -t "$chosen" &> /dev/null & | |
exit 0 | |
elif [[ $1 == 'create' ]]; then | |
chosen=$(tmux ls | awk -F: '{print $1}' | rofi -theme input.rasi -dmenu -i -p 'Create tmux session') |
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/bash | |
type=$1 | |
if [[ $type == 'python' ]]; then | |
# python shell dropdown | |
instance=$(xdotool search --classname python_dropdown) | |
if [[ $instance == '' ]]; then | |
#just open it if not running |
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/bash | |
# Dependencies: https://github.com/junegunn/fzf | |
# Convenient way of selecting connection on terminal when often ssh-ing or copying files from other servers | |
declare -A conn_pairs | |
conn_pairs["hostname_DEV"]="[email protected]" | |
conn_pairs["anotherhostname_STAGE"]="[email protected]" |