Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefano Fiorentino stefanofiorentino

View GitHub Profile
View gist:f49e459210b462b797ca884c05040887
From c1bc3bf02474fc4aa44e81b153e49b039a1f74b7 Mon Sep 17 00:00:00 2001
From: "Fiorentino Ing. Stefano" <stefano.fiore84@gmail.com>
Date: Fri, 22 May 2020 18:40:28 +0200
Subject: [PATCH] (extern) explicit instantiation of a type_factory
Signed-off-by: Fiorentino Ing. Stefano <stefano.fiore84@gmail.com>
---
.github/workflows/build.yml | 45 +-
...41fa871a7e818a75275294b82d2b3555ca79.patch | 1606 +++++++++++++++++
src/CMakeLists.txt | 15 +-
@stefanofiorentino
stefanofiorentino / git-hard-reset
Last active May 6, 2020
git hard reset from repo.log from git-repos
View git-hard-reset
#!/bin/bash
PREVPWD=${PWD}
echo "Current Directory -> " ${PREVPWD}
while IFS= read -r line
do
command=$(echo "$line" | awk 'BEGIN { FS = " " } ; {print "cd \""$2"\" && git reset --hard "$8}')
if eval "${command}"; then
echo "${command}"
@stefanofiorentino
stefanofiorentino / git filter-author
Created May 6, 2020
Change all signed-off on from..to commits
View git filter-author
#!/bin/bash
OLDSIGNED="stefano.fiorentino@home"
OLDNAME="Fiorentino Stefano"
NEWSIGNED="stefano.fiorentino@work"
NEWNAME="Stefano Fiorentino"
git filter-branch --msg-filter 'sed "s/'"${OLDSIGNED}"'/'"${NEWSIGNED}"'/g"' "$@"
git filter-branch --msg-filter 'sed "s/'"${OLDNAME}"'/'"${NEWNAME}"'/g"' "$@"
@stefanofiorentino
stefanofiorentino / git-custom-reset
Created May 5, 2020
Git custom reset to hard reset all your repos to a specific tag
View git-custom-reset
#!/bin/bash
if [[ ${1} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
then
for dir in $(find . -maxdepth 1 ! -path . -type d);
do
cd $dir
find . -type d -name '.git*' ! -path "*/poky-tmp/*" 2>/dev/null | \
sed 's/\.git$//g' | \
xargs -I '{}' sh -c 'readlink -e {};' | \
View git-reset-credentials
#!/bin/bash
sudo git config --system --unset credential.helper
git config --global --unset credential.helper
git config --unset credential.helper
@stefanofiorentino
stefanofiorentino / git-custom-push
Created Apr 24, 2020
push along with meaningful tags
View git-custom-push
#!/bin/bash
for dir in $(find . -maxdepth 1 ! -path . -type d);
do
cd $dir
find . -type d -name '.git*' ! -path "*/poky-tmp/*" 2>/dev/null | \
sed 's/\.git$//g' | \
xargs -I '{}' sh -c 'readlink -e {};' | \
uniq | \
sort | \
@stefanofiorentino
stefanofiorentino / subs_pragma_onces
Last active Apr 20, 2020
remove pragma onces at once
View subs_pragma_onces
#!/bin/bash
# grep -rn "#pragma once" src/* | sed 's/:1:#pragma once//g' > file_list
for name in $(cat file_list);
do
echo $name;
cleaned=$(echo $name | sed 's/src\/uvw\///g' | sed 's/\.hpp//g' | sed 's/\.h//g')
echo $cleaned
upper=$(echo $cleaned | tr '[a-z]' '[A-Z]' | xargs -r -n1 -I {} echo UVW_{}_INCLUDE_H)
@stefanofiorentino
stefanofiorentino / git-custom-tag
Last active Apr 24, 2020
git tag all repository in the current workdir
View git-custom-tag
#!/bin/bash
if [[ ${1} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
then
for dir in $(find . -maxdepth 1 ! -path . -type d);
do
cd $dir
find . -type d -name '.git*' ! -path "*/poky-tmp/*" 2>/dev/null | \
sed 's/\.git$//g' | \
xargs -I '{}' sh -c 'readlink -e {};' | \
@stefanofiorentino
stefanofiorentino / main2.cpp
Created Mar 31, 2020
libuvw example use of async and thread [uvw is a libuv c++ wrapper]
View main2.cpp
#include <uvw.hpp>
#include <cassert>
#include <iostream>
#include <memory>
#include <chrono>
int main() {
using namespace std::chrono_literals;
// get the default loop
View FindMosquittopp.cmake
# - Find libmosquittopp
# Find the native libmosquittopp includes and libraries
#
# MOSQUITTOPP_INCLUDE_DIR - where to find mosquitto.h, etc.
# MOSQUITTOPP_LIBRARIES - List of libraries when using libmosquittopp.
# MOSQUITTOPP_FOUND - True if libmosquittopp found.
if (NOT MOSQUITTOPP_INCLUDE_DIR)
find_path(MOSQUITTOPP_INCLUDE_DIR mosquitto.h)
endif()