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/bash | |
git fetch > /dev/null | |
# Get the list of branches from "git branch -a" using fzf for interactive selection | |
selected_branch=$(git branch -a | grep -v HEAD | sed 's/^[[:space:]]*//' | fzf --ansi --prompt="Select a branch (Use arrow keys): ") | |
if [ -n "$selected_branch" ]; then | |
if [ "$selected_branch" == "Exit" ]; then | |
echo "Exiting..." |
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
<template> | |
<!-- eslint-disable-next-line vue/no-v-html --> | |
<something-for-eslint /> | |
{{ | |
//@ts-ignore | |
formattedDate(collection[index].datetime) | |
}}</span | |
</template> |
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
import tailwindConfig from "../../tailwind.config"; | |
import resolveConfig from "tailwindcss/resolveConfig"; | |
const config = resolveConfig(tailwindConfig); |
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
bindsym Print exec "scrot -e 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'" | |
bindsym $mod+Print --release exec "scrot -ue 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'" | |
bindsym $mod+Shift+Print --release exec "notify-send 'selection will be saved to ~/tmp'; scrot -se 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'" |
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 | |
if [ -t 0 ]; then | |
if [ -z "$1" ]; then | |
echo "usage: tny long_url [custom_keyword]" | |
echo "" | |
echo "Shorten URLs with tny.im URL shortener" | |
echo "This script expects a long URL to shorten either as an argument or passed through STDIN." | |
echo "When using arguments, an optional second argument can be provided to customize the later part of the short URL (keyword)." | |
exit 1 | |
fi |
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/bash | |
# Launch a sakura terminal with the same directory as the terminal | |
# that has the focus | |
# based on https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/ | |
ID=$(xdpyinfo | grep focus | cut -f4 -d " ") | |
PID=$(xprop -id $ID | grep PID | awk ' { print $3 }') | |
SHELL_PID=$(ps -opid= --ppid $PID | tr -d '[:space:]') | |
CWD="/proc/$SHELL_PID/cwd" |
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
function gshow() { | |
tmp_dir=$(mktemp -d) | |
filename=$(basename $2) | |
tmp_path="$tmp_dir/$filename" | |
git show $1:$2 > $tmp_path | |
$EDITOR $tmp_path | |
rm $tmp_path | |
rmdir $tmp_dir | |
} |
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/bash | |
# LAYOUT SWITCHER | |
# This script provides following functionality: | |
# - When detect is given, the | |
# - When no argument is given, make a dmenu list of the available screen layouts | |
# Last two options are mostly used by the udev system | |
BASE_PATH="/home/sh/.screenlayout" | |
AVAILABLE_LAYOUTS=$(ls -1 $BASE_PATH | awk -F '.' '{ print $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 python | |
""" | |
git fuzzy-checkout | |
Same as `git checkout branch`, but with fuzzy matching if checkout fails. | |
Turns `git checkout barnch` into `git checkout branch`, | |
assuming `branch` is a branch. | |
""" | |
import difflib | |
import sys |
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 python | |
import sys | |
from plumbum.cmd import git | |
from termcolor import cprint | |
try: | |
new_branch = sys.argv[1] | |
except IndexError: | |
print("Provide a branch name!", file=sys.stderr) |
NewerOlder