Skip to content

Instantly share code, notes, and snippets.

Avatar

Nir Geier nirgeier

  • CodeWizard
  • Israel
View GitHub Profile
@nirgeier
nirgeier / sample_replacement.sh
Created October 25, 2022 09:43
Replace text (ex: server url) in AzureDevOps comments
View sample_replacement.sh
##
## Global variables
##
# The string which we wish to replace
STR_TO_REPLACE="STR_TO_REPLACE"
# The new value
STR_REPLACMENT="New Server URL"
@nirgeier
nirgeier / install.sh
Created February 27, 2021 11:28 — forked from rexlow/install.sh
Enable zsh in Gcloud shell
View install.sh
##
# This is an adoption from Oh My Zsh for Google Cloud Shell
# author - bobvanluijt
# source - https://github.com/bobvanluijt/google-cloud-shell-pro-zsh
##
main() {
# Install zsh
sudo apt-get -qq update
@nirgeier
nirgeier / get-latest-tag-on-git.sh
Created October 7, 2020 14:46 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
View get-latest-tag-on-git.sh
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
View dummy
# without `:` the values are optionals
while getopts abc flag;
do
case "${flag}"
in
a ) echo $optarg ; pa="$OPTARG"; echo $pa;;
b ) pb=${OPTARG};;
c ) pc=${OPTARG};;
\?) echo "Invalid option: kubde" 1>&2 ;;
: ) echo "Invalid option: $OPTARG requires an argument" 1>&2;;
@nirgeier
nirgeier / gitbash-az
Created April 28, 2020 21:36
Add az command to Git-bash
View gitbash-az
# Add az (Azure cli) to git bash
echo "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} > "%USERPROFILE%\AppData\Local\Programs\Git\mingw64\bin\az"
@nirgeier
nirgeier / generateSANCertificate.sh
Created February 23, 2020 19:28
Generate SAN Certificate
View generateSANCertificate.sh
#############################################################################
## Usage: ##
## ##
## *** Requirements - CA certificate, privateKey & password ##
## ----------------------------------------------------------------------- ##
## Open git bash ##
## ##
## - Save this file as <fileName>.sh ##
## - Set the desired domains under [ alt_names ] ##
## or set the domains in array ##
View gist:b84da56926b1231ff2860192eb378b83
Acai
Aceola
Alfalfa Sprouts
Apple
Apricot
Apricots
Artichoke
Asian Pear
Asparagus
Atemoya
@nirgeier
nirgeier / GitScripts.sh
Last active February 26, 2019 10:11
Gti scripts
View GitScripts.sh
# Get last commit timestap of all branches in the remote
git fetch --all && for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@nirgeier
nirgeier / ajax-exercises.txt
Created August 23, 2017 23:12 — forked from pamelafox/ajax-exercises.txt
AJAX Exercises
View ajax-exercises.txt
Exercise: Nutrition Facts
Create an empty webpage.
Download nutrition.xml from https://gist.github.com/3000322 and place in your project folder.
Use AJAX via jQuery or JS API to fetch the file into the page.
Create a table. For each <food> in the XML file, create a row in the table with the food name and nutritional facts - serving size, calories, carbs.
Bonus: Use the tablesorter jQuery plugin to make the table sortable by the nutritional facts.
Exercise: Lady Gaga News