Skip to content

Instantly share code, notes, and snippets.

View eugesh's full-sized avatar
💭
This is my backup repo. For drafts and sketches.

Evgeny Shtanov eugesh

💭
This is my backup repo. For drafts and sketches.
View GitHub Profile
@awesomebytes
awesomebytes / qt_serialbus.md
Last active February 1, 2023 09:58
Use qt serialbus in ubuntu 18.04 with qt 5.9

Using the Qt serialbus (to access a CAN bus) in Ubuntu 18.04

I was trying to compile a Qt project that uses the Qt serialbus module and it was not configuring when using qmake, the error was: Unknown module(s) in QT: serialbus. So I needed to build qtserialbus myself.

While trying to build it I ran into: fatal error: private/qobject_p.h: No such file or directory.

# Overkill: get all qt-stuff
sudo apt install qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras qml-module-qtquick-controls2 qt5-default libqt5quickcontrols2-5 qtquickcontrols2-5-dev qtcreator qtcreator-doc libqt5serialport5-dev build-essential qml-module-qt3d qt3d5-dev qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active April 25, 2024 03:01
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@LionZXY
LionZXY / Список книг.txt
Last active March 11, 2024 13:25
Для раздачи на рутрекере https://rutracker.org/forum/viewtopic.php?t=5690655
Под общей редакцией А.В. Пролетарского - Технологии коммутации и маршрутизации в локальных компьютерных сетях - 2013
А.Ф. Третьяков, Л.В. Тарасенко - Материаловедение и технологии обработки материалов - 2014
В.П. Строгалев, И.О. Толкачева, Н.В. Быков - Основы прикладной газовой динамики - 2014
О.П. Феоктистова, Е.Б. Гартиг, А.А. Пожалостин, А.А. Панкратов - Кинематика точки и простейшие движения твердого тела - 2012
Под редакцией И.П. Мачневой - Сборник домашних заданий для студентов специальности "Средства поражения и боеприпасы". Часть 2 - 2014
Т.М. Волосатова, С.В. Родионов, Д.Т. Шварц - Прикладное программирование на языке C++ - 2015
В.С. Попов - Линейная алгебра - 2016
М.В. Белодедов, О.М. Михайлова, М.М. Абулкасимов - Электротехника - 2015
И.В. Телеснина - Танцуем с удовольствием - 2008
С.В. Резник, О.В. Денисов - Постановка тепловых испытаний элементов композитных стержневых космических конструкций. Часть 1. Расчетно-теоретические исследования (2-е издание) - 2017
@jstnlvns
jstnlvns / git: gitignore.md
Created November 16, 2018 19:42
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@blackvitriol
blackvitriol / map.qml
Created March 18, 2018 06:04
sample map for Qt QML
import QtQuick 2.0
import QtQuick.Window 2.0
import QtLocation 5.6
import QtPositioning 5.6
Rectangle {
width: 1500
height: 1000
visible: true
@lb5160482
lb5160482 / rotm2quat.cpp
Created January 15, 2018 21:54
Rotation matrix to quaternion conversion c++
inline float SIGN(float x) {
return (x >= 0.0f) ? +1.0f : -1.0f;
}
inline float NORM(float a, float b, float c, float d) {
return sqrt(a * a + b * b + c * c + d * d);
}
// quaternion = [w, x, y, z]'
Mat mRot2Quat(const Mat& m) {
@geohot
geohot / ransac_polyfit.py
Last active July 31, 2023 06:39
RANSAC polyfit. Fit polynomials with RANSAC in Python
def ransac_polyfit(x, y, order=3, n=20, k=100, t=0.1, d=100, f=0.8):
# Thanks https://en.wikipedia.org/wiki/Random_sample_consensus
# n – minimum number of data points required to fit the model
# k – maximum number of iterations allowed in the algorithm
# t – threshold value to determine when a data point fits a model
# d – number of close data points required to assert that a model fits well to data
# f – fraction of close data points required
besterr = np.inf
@chris-marsh
chris-marsh / qtextdocument_printing.cpp
Created October 15, 2017 09:59
Qt Paginated Printing
// QTextDocument printing example written by David Faure for EADS
// Compared to QTextDocument::print, it allows to add a page header and footer.
#include <QPrinter>
#include <QPainter>
#include <QProgressDialog>
#include <QApplication>
#include <QTextDocument>
#include <QTextTableCell>
#include <QTextCursor>
@mistic100
mistic100 / qchecklist.h
Created January 23, 2017 19:13
[Qt/C++] QComboBox with support of checkboxes
#ifndef QCHECKLIST
#define QCHECKLIST
#include <QWidget>
#include <QComboBox>
#include <QStandardItemModel>
#include <QLineEdit>
#include <QEvent>
#include <QStyledItemDelegate>
#include <QListView>