Skip to content

Instantly share code, notes, and snippets.

Konstantinos konfou

View GitHub Profile
@konfou
konfou / .bash_profile.sh
Last active Jul 26, 2018 — forked from mrpoptart/.bash_profile.sh
Today, bash_profile based task logger
View .bash_profile.sh
today() {
[[ -z "$*" ]] && < ~/.today || echo "$(date +'%F %T') $*" >> ~/.today
}
View do-until.jl
"""
@do begin
body
end when condition
Macro emulating a do-until construct.
"""
@eval macro $(:do)(body, when::Symbol, condition)
quote
while true
@konfou
konfou / script.js
Last active Oct 25, 2017 — forked from vielhuber/script.js
replace all occurences in a string without regex #js
View script.js
String.prototype.replaceAll = function(foo, bar) {
return this.split(foo).join(bar);
};
@konfou
konfou / ascii.m
Last active Oct 25, 2017
display an ASCII chart (Octave)
View ascii.m
chr = char(32:127)(:);
spc = ' ' * ones(length(chr), 1);
nms = num2str([32:127](:));
tab = [nms spc chr spc];
qti = reshape(tab',length(tab)/2,[])';
disp(qti)
@konfou
konfou / README.md
Last active Jul 2, 2020
play-with-mpv youtube-dl compatible sites
View README.md

The following files have been adapted from ViewTube userscript 'protocol' [[1]] instructions. But I find no reason using such a complex script just for opening a video to mpv, so instead I opted out to using a bookmarklet. The files may be installed as follows:

user$ mkdir -p $HOME/.local/{bin,share/applications}
user$ cp notube.desktop $HOME/.local/share/applications/notube.desktop
user$ install -D -m 755 notube.sh $HOME/.local/bin/notube.sh
user$ xdg-mime default notube.desktop x-scheme-handler/notube
@konfou
konfou / lolbash.sh
Last active Aug 24, 2017 — forked from norova/lolbash.sh
gist interface doesn't allow me to paste so I post my edited version on https://gitlab.com/snippets/1672613
View lolbash.sh
# LOL!!1
alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
alias visible='echo'
alias invisible='cat'
alias moar='more'
alias icanhas='mkdir'
alias donotwant='rm'
alias dowant='cp'
@konfou
konfou / mkvextract-helper.sh
Last active Jul 5, 2020
extract all tracks/attachments/chapters from an mkv file
View mkvextract-helper.sh
#!/usr/bin/env bash
#
# Extract all tracks/attachments/chapters from an mkv file.
# depends
type -p mkvmerge &>/dev/null || exit 3
type -p mkvextract &>/dev/null || exit 3
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
@konfou
konfou / cbr2cbz.sh
Last active May 16, 2017
convert *.cbr to *.cbz
View cbr2cbz.sh
#!/usr/bin/env bash
#
# Convert cbr files to cbz.
# depends
type -p 7z >/dev/null || exit 3
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
@konfou
konfou / csv2tex.sh
Created May 16, 2017
convert *.csv to a TeX table
View csv2tex.sh
#!/usr/bin/env bash
#
# Convert CSV file(s) to a TeX table.
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
caption="Πειραματικά δεδομένα."
label_template="tab:"
out_template="tab-"
@konfou
konfou / sf-cvs2git.sh
Last active May 16, 2017
cvs.sourceforge-to-git
View sf-cvs2git.sh
#!/usr/bin/env bash
#
# Convert a Sourceforge's CVS repo to Git.
# depends
type -p rsync >/dev/null || exit 3
type -p cvs2git >/dev/null || exit 3
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
You can’t perform that action at this time.