Skip to content

Instantly share code, notes, and snippets.

View mariotti's full-sized avatar
💭
working @ 1plusX for the moment

mariotti mariotti

💭
working @ 1plusX for the moment
View GitHub Profile
@mariotti
mariotti / percent_pop.sh
Created March 22, 2020 19:51
Simple get pro mille on population from COVID-19 data
#! /bin/bash
# To run this you will need to do first:
# 1) Get the data
# git clone https://github.com/CSSEGISandData/COVID-19; cd COVID-19
# 2) Run this script
# 3) Optionally plot them ... example for gnuplot at the end
#
# countriesPop="Switzerland:8570 Italy:60480 Spain:46660 Germany:82790 France:66990"
# Does not for all countries, for example France has "states"
#
@mariotti
mariotti / makeJSONfromMK
Created November 28, 2016 22:39
make json from markdown - markdown to json
#! /bin/sh
#
QQ="QUESTIONS.md"
#QQ="bin/makeJSONfromQ.QUESTIONS.test.md"
cat ${QQ} | tail +4 | sed 's/"/``/g' | \
awk 'BEGIN { Ccount=0; Qcount=0; QCcount=0; Ncount=0; firtsC=0; firstQ=0 } \
/^\*\*/ {Ccount++; QCcount=0; gsub(/^\*\*/,"",$0);gsub(/\*\*$/,"",$0);\
if (Ccount >1) \
{print "\t\t\t}\n\t\t]\n\t\t},"}
else {print "{ \"TechQuestions\" :\n\t{ \"category\" :\n\t["}; \
@mariotti
mariotti / taritdate.sh
Created September 4, 2015 16:15
Tar a directory adding the date
#! /bin/sh
#
# F.Mariotti: taritdate.sh
#
# Simple help text
if [ -z $1 ]; then
echo "please give a dir name."
exit 1;
fi;
#
@mariotti
mariotti / gplot.csh
Created September 4, 2015 15:50
quick plot data with gnuplot
#! /bin/tcsh
#
if ("a$1" == "a") then
echo "give a file name..."
exit
endif
if ("a$1" == "ahelp") then
echo "Usage: $0 <datafilename> [numcols]"
echo ""
exit