Skip to content

Instantly share code, notes, and snippets.

View hauke96's full-sized avatar

Hauke Stieler hauke96

View GitHub Profile
View command_stub.sh
# Parses the install specific arguments
# Needed parameter: $@
function parse_install_args(){
for (( i=1; i<=$#; i++ ))
do
arg=${@:$i:1} # Gets the string i
val=${@:$i+1:1} # Gets the string i+1
case $arg in
-h|--help)
View command.sh
#!/bin/bash
# Global variables
package=
command=
# Some have default values
parsing_succeeded=true
# Parses the install specific arguments
View simple_stub.sh
for (( i=1; i<=$#; i++ ))
do
arg=${@:$i:1} # Gets the string i
val=${@:$i+1:1} # Gets the string i+1
case $arg in
-p)
package=$val
# The parse the next argument and not this value
((i++))
View simple.sh
#!/bin/bash
# Global variables
package=
command=
# Some have default values
parsing_succeeded=true
for (( i=1; i<=$#; i++ ))
@hauke96
hauke96 / libffmpeg_vivaldi.md
Last active July 4, 2023 18:56
Install libffmpeg.so in vivaldi
View libffmpeg_vivaldi.md
@hauke96
hauke96 / logger.go
Last active July 29, 2017 15:30
Simple logger for golang
View logger.go
package logger
import (
"fmt"
"os"
"runtime"
"runtime/debug"
"strconv"
"strings"
)