Skip to content

Instantly share code, notes, and snippets.

View artivis's full-sized avatar

Jeremie Deray artivis

View GitHub Profile
@mbinna
mbinna / effective_modern_cmake.md
Last active April 17, 2025 03:18
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@facontidavide
facontidavide / GenericROSPublisher.cpp
Created September 12, 2017 14:48
Generic ROS publisher using ShapeShifter
#include "ros/ros.h"
#include "sensor_msgs/JointState.h"
#include "topic_tools/shape_shifter.h"
#include "ros/message_traits.h"
#include <sstream>
template <typename T>
void SerializeToByteArray(const T& msg, std::vector<uint8_t>& destination_buffer)
{
const uint32_t length = ros::serialization::serializationLength(msg);
#include <iostream>
#include <brigand/brigand.hpp>
template<typename Members>
class TaggedTuple{
template<typename TagType>
struct createMember{
using type = typename TagType::type;
};
anonymous
anonymous / .bashrc
Created September 27, 2016 19:19
How to change cursor shape, color, and blinkrate of Linux Console
##############
# pretty prompt and font colors
##############
# alter the default colors to make them a bit prettier
echo -en "\e]P0000000" #black
echo -en "\e]P1D75F5F" #darkred
echo -en "\e]P287AF5F" #darkgreen
echo -en "\e]P3D7AF87" #brown
echo -en "\e]P48787AF" #darkblue
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active March 31, 2025 15:46
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@silgon
silgon / distance_angle_pose_to_point.cpp
Last active March 21, 2024 02:59
Get distance and angle of the closest obstacle from pose and map
#include <ros/ros.h>
#include <nav_msgs/OccupancyGrid.h>
#include <geometry_msgs/PoseStamped.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
#include <iterator>
#include <vector>
// some definitions of functions
#define MAP_INDEX(map, i, j) ((i) + (j) * map.size_x)
@tfc
tfc / comparison_impl.cpp
Last active November 22, 2017 19:14
comparison_impl<T> implementation example code
#include <assert.h>
template <typename T>
class comparison_impl
{
const T& thisT() const { return *static_cast<const T*>(this); }
public:
// operator== is implemented by T
template <typename U>
@Jiwan
Jiwan / main.cpp
Created February 4, 2016 22:05
Final C++14 example for my post - An introduction to C++'s variadic templates: a thread-safe multi-type map
#include <iostream>
#include <memory>
#include <string>
#include "repository.hpp"
// Incomplete types used as compile-time keys.
struct Key1;
struct Key2;
#!/bin/bash
#
# Compare two PDF files.
# Dependencies:
# - pdfinfo (xpdf)
# - pdfjam (texlive-extra-utils)
# - diffpdf
#
MAX_HEIGHT=15840 #The maximum height of a page (in points), limited by pdfjam.
@xero
xero / irc.md
Last active April 17, 2025 15:44
irc cheat sheet