Skip to content

Instantly share code, notes, and snippets.

View rajithacharith's full-sized avatar

Charith rajitha rajithacharith

View GitHub Profile
@rajithacharith
rajithacharith / generate_certs.sh
Created May 28, 2022 02:34
This gist will contain the commands to generate private keys and certificates for the CarParkServer and CarParkClient which was used for the securing gRPC api blog
echo "----------------------------------------------------------------------------------"
echo "| Generating private keys and certs for CarParkServer and CarParkClient |"
echo "----------------------------------------------------------------------------------"
# Check the availability of openssl.
readonly KEYTOOL=$(which keytool)
if [[ ! ${KEYTOOL} ]]
then
echo "keytool is not installed. Exiting !"
exit 1
@rajithacharith
rajithacharith / Code.gs
Created September 4, 2021 18:40
Read Covid19 live update API and collect data to Google Sheet
var API_URL = 'https://api.covid19api.com/live/country/Sri-lanka';
var SHEET_NAME = 'DataSheet';
var HEADER_RANGE = "A1:F1";
var HEADERS = ["ID", "Confirmed", "Deaths", "Recovered", "Active", "Date"]
var DATA_START_COL_ID = 1;
var FILEDATA_RANGE = "A2:A";
/**
* This is a helper function to filter out empty values in an array.
*/
@rajithacharith
rajithacharith / sample-data.json
Created September 4, 2021 18:33
Sample Data from Covid 19 API
[
{
"ID":"4f8ec0a8-9c59-4d80-bcf5-a3f5ebb9cfa9",
"Country":"Sri Lanka",
"CountryCode":"LK",
"Province":"",
"City":"",
"CityCode":"",
"Lat":"7.87",
"Lon":"80.77",