Skip to content

Instantly share code, notes, and snippets.

@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@dfch
dfch / HttpClient.cs
Last active November 26, 2023 16:59
HttpClient and how to use Headers, Content-Type and PostAsync
// HttpClient and how to use Headers, Content-Type and PostAsync
// http://d-fens.ch/2014/04/12/httpclient-and-how-to-use-headers-content-type-and-postasync/
// Copyright 2014-2015 Ronald Rink, d-fens GmbH
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0