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
| @echo off | |
| PUSHD %~dp0 | |
| :: Do some stuff | |
| :: Return to the caller directory | |
| POPD |
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
| if (git tag 2>$null) { | |
| git rm -r --cached . | |
| git clean -dfX | |
| git add . | |
| } else { | |
| Write-Host "fatal: not a git repository (or any of the parent directories): .git" | |
| } |
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 | |
| kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
| #kubectl get pods --all-namespaces --field-selector 'status.phase==Failed' -o json | kubectl delete -f - |
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
| #pragma once | |
| #include <limits> | |
| /** | |
| * Check if a and b are within epsilon range of eachother. | |
| * | |
| * Based on this post: https://www.reddit.com/r/ProgrammerHumor/comments/ggwxjp/the_dwindling_sanity_of_valves_programmers/fq646zf?utm_source=share&utm_medium=web2x | |
| **/ | |
| template<typename T> // Numeric type |
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 | |
| docker rm -v $(docker ps -a -q -f status=exited) | |
| docker rmi $(docker images -f "dangling=true" -q) | |
| if [[$1 == "-vfs" ]]; then | |
| docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin | |
| fi |
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 | |
| # https://wiki.archlinux.org/index.php/Wake-on-LAN | |
| sudo pacman -Syu ethtool | |
| # d (disabled), p (PHY activity), u (unicast activity), m (multicast activity), | |
| # b (broadcast activity), a (ARP activity), and g (magic packet activity) | |
| ethtool <interface> | grep Wake-on | |
| # If not g | |
| ethtool -s <interface> wol g |
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 | |
| # Git branch recognizer # TODO: Auto add | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| if [ "$color_prompt" = yes ]; then | |
| PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\$ ' | |
| else | |
| PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' |
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
| #pragma once | |
| #include <cpprest/json.h> | |
| /** | |
| * @brief Parse a JSON file into a JSON object. | |
| * | |
| * @param jsonFileName The path to the JSON file to parse. | |
| */ |
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
| # Allows the use of external Git repositories outside of a Git project | |
| # The contents of ${OUTPUT_DIR} should be in the appropriate .gitignore | |
| find_package(Git QUIET) | |
| function(clone_submodule REPO_URL BRANCH OUTPUT_DIR) | |
| if(GIT_FOUND) | |
| message(STATUS "Cloning git submodule from ${REPO_URL}") | |
| execute_process( |
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
| # ------------------------------------------------------------------------------ | |
| # Clang Format | |
| # ------------------------------------------------------------------------------ | |
| OPTION(ENABLE_FORMAT "Run clang-format on all files in src/ and include/" OFF) | |
| if(ENABLE_FORMAT) | |
| # Get all project files | |
| file(GLOB_RECURSE ALL_CXX_SOURCE_FILES | |
| ${PROJECT_SOURCE_DIR}/src/*.[chi]pp | |
| ${PROJECT_SOURCE_DIR}/src/*.[chi]xx |