Skip to content

Instantly share code, notes, and snippets.

View winwinashwin's full-sized avatar
sipping coffee

Ashwin A Nayar winwinashwin

sipping coffee
View GitHub Profile
#!/bin/bash
# Temporary cookie jar
tmpfile=$(mktemp)
cleanup() {
rm -rf "$tmpfile"
}
trap cleanup EXIT
@winwinashwin
winwinashwin / get_env.sh
Last active October 19, 2021 13:17
ROSx Environment variables fetch script for IDE Build configuration
#!/bin/bash
# Prints all ROS specific environment variables used for building the package. Intended to be used for configuring IDE
# environment variables.
#
# Tested with ROS Noetic, ROS Melodic and ROS2 Foxy
#
# @author: Ashwin A Nayar
read -rd '' ROS2_VARS << EOL
@winwinashwin
winwinashwin / macrologger.hpp
Created May 21, 2021 16:10
Simple and macrofied logging | C++
/**
* @file macrologger.hpp
*
* @brief Quick and simple logging for C++ projects
*
* @author David Rodrigues (primary author)
* @author Ashwin A Nayar
*
* Add compile flag -DLOG_LEVEL=<value> to set log level
*
@winwinashwin
winwinashwin / Instrumentor.hpp
Last active May 1, 2023 02:59 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler for C++ | Macro-fied
/**
* @file Instrumentor.hpp
*
* @brief Basic Instrumentation Profiler for C++ | Macro-fied
*
* Upon execution of profile macro embedded source code, all the profiling data
* is dumped to a JSON file compatible with Chrome Tracing tool. The JSON file can
* then be loaded to chrome tracing (chrome://tracing) to visualise the data.
*
* @author TheCherno (primary author)