Skip to content

Instantly share code, notes, and snippets.

View criztovyl's full-sized avatar

Christoph Schulz criztovyl

View GitHub Profile
@criztovyl
criztovyl / ssj.sh
Last active August 29, 2015 14:25
Splits, sorts and joins a string by a separator
#!/bin/bash
# A Bash/Ruby script that splits, sorts and joins a string
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / pimus.sh
Last active August 29, 2015 14:27
Opens remote cmus screen in current shell. Starts cmus if it's not running.
#!/bin/bash
pimus()
{
# Try to show cmus screen, start new cmus instance into cmus screen if not available
if ! screen -qr cmus; then
# Start new cmus into cmus screen
screen -mdS cmus cmus
# Wait for cmus socket (up to 5x5 seconds)
@criztovyl
criztovyl / gpl-init.sh
Last active July 1, 2016 14:01
Initializes files with GPL or adds it to existing files.
#!/bin/bash
# A small tool to init files with a GPL header.
# Copyright (C) 2015 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / monthdiff.sh
Created January 26, 2016 22:05
Calculates differences between months, also across years.
#!/bin/bash
# Script for calculating month differences
# Copyright (C) 2016 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / bandcamp_discography.sh
Last active August 7, 2016 16:00
Sorts a Bandcamp discography by release date
#!/bin/bash
# Utility for Bandcamp discographies
# Copyright (C) 2016 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / gist-clone.sh
Last active July 13, 2018 18:34
Clones a GitHub Gist into an directory with the Gist's name.
#!/bin/bash
# Clones a GitHub Gist into an directory with the Gist's name.
# Copyright (C) 2016 Christoph "criztovyl" Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / notify-send-remote.sh
Last active January 14, 2017 22:03
Hacky-Hacky notify-send hack for sending from cron(tab).
#!/bin/bash
# Hacky-Hacky notify-send hack for sending from cron(tab).
# Copyright (C) 2016 Christoph criztovyl Schulz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@criztovyl
criztovyl / devpath.sh
Last active June 27, 2016 17:21
Overwrite a command with it's development one.
devpath()
{
DEVPATH_DIR=$HOME/.local/share/devpath
DEVPATH_RE='.*devpath/.'
if [[ "$1" =~ ^-{0,2}h(elp)?$ ]] || [[ -z "$1" ]]; then
echo "Usage: devpath scriptName" >&2
echo "or : devpath -l|--list" >&2
return 0
elif [[ "$1" =~ ^-{0,2}l(ist)?$ ]]; then
@criztovyl
criztovyl / gpl-comment.sh
Last active July 1, 2016 13:13
Tries to display the description line of a GPLed file.
gpl-comment()
{
[[ "$1" =~ ^-{0,2}h(elp)?$ ]] && { echo -e "Tries to display the description line of a GPLed file.\nUsage: gpl-comment file"; return 0; }
echo $(head -n2 $1 | tail -n1 | sed 's/^\W \?//')
}
@criztovyl
criztovyl / da_gallery_dl.rb
Last active April 13, 2016 16:30
Downloads a full devian art gallery.