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/python | |
import subprocess | |
from time import sleep | |
from pprint import pprint | |
window_name = "\"Gnome-terminal\"" # exact name, can be changed to other window name | |
default_delay_time = 1 | |
import sys |
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 | |
# test git is working in cwd | |
# git || exit 1 | |
# declare a wrapper function for git | |
git() { | |
command git "$@" || exit 1 | |
} |
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 | |
SAVEIFS=$IFS | |
IFS="$(printf '\n\t')" | |
DEFAULT_FNAME=compressed_output | |
DEFAULT_FORMAT=tar.gz | |
SCRIPT="$(basename $0)" | |
function help { | |
printf "Usage: %s [-o|--output FNAME] [-f|--format FORMAT] <file1> [file2] ... [-- [OPTS_TO_PASSTHROUGH]]\n" "$SCRIPT" |
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 | |
# from https://tex.stackexchange.com/questions/42236/pdfcrop-generates-larger-file/42259 | |
function usage () { | |
echo "Usage: `basename $0` [Options] <input.pdf> [<output.pdf>]" | |
echo | |
echo " * Removes white margins from every page in the file. (Default operation)" | |
echo " * Trims page edges by given amounts. (Alternative operation)" | |
echo |
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 | |
result="$(curl https://assh-dev.herokuapp.com/assh-to-ssh -X POST -F "assh_config=<$HOME/.ssh/assh.yml" | jq -r .ssh_config)" | |
# uncomment Hostname and remove colon | |
result="$(echo "$result" | sed 's/# HostName:/HostName/g')" | |
# delete proxycommand line | |
result="$(echo "$result" | sed '/ProxyCommand/d')" |
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 | |
# | |
# @file gist+x.sh | |
# | |
# Gives executable file permissions to files in a Gist. | |
# | |
set -e | |
prog=`basename "$0"` | |
# Command line options. |
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 | |
# This hooks script syncs task warrior to the configured task server. | |
# The on-exit event is triggered once, after all processing is complete. | |
# let's do a quick check. If the taskw command already is synchronize, we | |
# wouldn't need to run this script:) | |
for arg in $*; do | |
if [[ "$arg" == api:* ]]; then | |
IFS=':' | |
read -ra api_level <<< "$arg" |
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 | |
# By soraxas | |
# This file shall be the wrapper for taskwarrior | |
# Do something like: | |
# alias task="taskwarrior-datetime-parser-wrapper" | |
# argunments that contain datetime format | |
TIME_FORMAT="(^|\W)(until|wait|due|scheduled):" | |
TASK="$(which task)" |
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
// git.io url: https://tinyurl.com/SurfingKeys-settings or https://git.io/JfXjB | |
// inspired by https://github.com/Foldex/surfingkeys-config/blob/master/config.js | |
// remove conflict with browser's history, download pannel toggle | |
// unmap('<Ctrl-j>'); | |
// iunmap('<Ctrl-j>'); | |
// vunmap('<Ctrl-j>'); | |
// unmap('<Ctrl-h>'); | |
// iunmap('<Ctrl-h>'); | |
// vunmap('<Ctrl-h>'); |
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
# This is slower, to echo everything one by one. | |
# | |
# function __fish_tldr_complete_available_pages | |
# for f in ~/.local/share/tldr/pages/**/*.md | |
# echo (string replace -r '.*/([^/]*)\.md' '$1' $f) | |
# end | |
# end | |
#complete -x -c tldr -a '(__fish_tldr_complete_available_pages)' | |
# it is faster to find everything and use a single sed command to replace it to the correct format. |
OlderNewer