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
mkcd () { | |
mkdir -p "$1" && cd "$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
#eg for cinder:- | |
for i in $( ls /etc/init.d/cinder-* | xargs -n 1 basename ); do sudo service $i restart; done |
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
QString QArgByKey(QString key, QChar sep = QChar('\0') ); //prototype usually in separate header | |
QString QArgByKey(QString key, QChar sep ) | |
{ | |
bool sepd=sep!=QChar('\0'); | |
int pos=sepd?qApp->arguments().indexOf(QRegExp('^'+key+sep+"\\S*")):qApp->arguments().indexOf(QRegExp(key)); | |
return pos==-1?QString::null: | |
(sepd?qApp->arguments().at(pos).split(sep).at(1):(++pos<qApp->arguments().size()?qApp->arguments().at(pos):QString::null)); | |
} |
NewerOlder