Skip to content

Instantly share code, notes, and snippets.

View vlantonov's full-sized avatar
🏠
Working from home

Vladislav Antonov vlantonov

🏠
Working from home
  • flatexDEGIRO
  • Sofia
View GitHub Profile
@vlantonov
vlantonov / Dockerfile
Created January 8, 2024 19:32
Minimal docker-compose
FROM httpd:2.4-alpine
COPY index.html /var/www/html/
WORKDIR /var/www/html
CMD ["apachectl", "-D", "FOREGROUND"]
EXPOSE 80
@vlantonov
vlantonov / example.cpp
Created March 22, 2022 07:29
C++ Static object method exception can be caught
#include <exception>
class Test {
Test() = default;
public:
static Test& instance() {
static Test single;
return single;
}
@vlantonov
vlantonov / test_locale.cpp
Created March 22, 2022 07:26
Locales in C++
#include <cmath>
#include <iostream>
#include <locale>
#include <sstream>
bool checkFloatParse()
{
constexpr double number = 1.5;
constexpr auto numberString = "1.5";
@vlantonov
vlantonov / tuple_parser.cpp
Created March 22, 2022 07:25
C++ Tuple Parser
// Example program
#include <iostream>
#include <string>
#include <tuple>
#include <sstream>
template<class Tuple, std::size_t N>
struct TupleReader {
static void set(std::stringstream& ss, Tuple& t)
{
#How to generate debian for package foobar
# Need to have install pip package stdeb
PKG=foobar
pip install -d . $PKG
tar xfvz $PKG*.tar.gz
cd $PKG*
python setup.py --command-packages=stdeb.command bdist_deb
#Debian is generated within deb_dist directory
@vlantonov
vlantonov / simple_debian_repository.md
Created March 18, 2022 12:50 — forked from awesomebytes/simple_debian_repository.md
How to create a simple debian repository with minimal dependences

Simple debian repository

How to have a simple debian repository to offer your packages.

Requirements

You probably have them already installed

  • Python (I used 2.7).
  • dpkg-scanpackages: sudo apt-get install dpkg-dev
  • gzip: sudo apt-get install gzip
@vlantonov
vlantonov / debian_from_ros_pkg.md
Created March 18, 2022 12:50 — forked from awesomebytes/debian_from_ros_pkg.md
How to create a debian from a ROS package
@vlantonov
vlantonov / image_encoder_decoder.py
Last active December 10, 2021 11:44
Image encoder/decoder
import sys
import cv2 as cv
import numpy as np
argvs=sys.argv
if (len(argvs) != 2):
print(f'Usage: {argvs[0]} image_file')
quit()
image_file_name = argvs[1]
@vlantonov
vlantonov / os_macro.cpp
Created November 30, 2021 11:41
C++ OS dependent macroses
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!" << '\n';
#ifdef __linux__
cout << "Linux and Linux-derived" << '\n';
#endif
@vlantonov
vlantonov / macro_test.cpp
Created November 30, 2021 09:33
C++ reflection
#include <iostream>
#include <string>
#define DefineClassName(className) \
\
template<> \
std::string Base::name<className>() \
{ \
return #className; \
} \