Skip to content

Instantly share code, notes, and snippets.

View RoyBellingan's full-sized avatar

Roy Bellingan RoyBellingan

View GitHub Profile
@RoyBellingan
RoyBellingan / array.cpp
Created September 26, 2020 20:10
std::array
#include <array>
#include <stdio.h>
int main(){
std::array<int,6> v;
v[1] = 4;
printf("%i \n", v[1]);
return v[1];
}
****************
#include <iostream>
#include <map>
template <typename K, typename V>
class Map2 : public std::map<K, V> {
public:
[[nodiscard]] auto get(const K& k) const {
struct Founded {
const V val;
bool found = false;
@RoyBellingan
RoyBellingan / xorg.conf
Created June 19, 2020 23:57
Roy xorg.xonf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 440.64
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Inactive "InactiveDevice1"
Inactive "InactiveDevice1"
InputDevice "Keyboard0" "CoreKeyboard"
Just opening a file from the search bar down
#0 0x00007ffff45cfde1 in __memmove_avx_unaligned_erms () from /lib64/libc.so.6
#1 0x00007fffee91ab26 in QFontEngineFT::loadGlyph(QFontEngineFT::QGlyphSet*, unsigned int, QFixed, QFontEngine::GlyphFormat, bool, bool) const ()
from /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#2 0x00007fffee91bfba in QFontEngineFT::loadGlyphFor(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&, bool, bool) ()
from /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#3 0x00007fffee91c3d1 in QFontEngineFT::glyphData(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&) ()
from /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#4 0x00007ffff6755e04 in QRasterPaintEngine::drawCachedGlyphs(int, unsigned int const*, QFixedPoint const*, QFontEngine*) ()
@RoyBellingan
RoyBellingan / selfCompiled1.cpp
Last active April 30, 2020 10:56
selfCompiled1.cpp
Compiled from 494b9f5287f72bafb07cdff5fe5f68bc352ee53a
suse 15.1 gcc 7.5 qt 14.2
void TextEditorWidget::paintBlock(QPainter *painter,
const QTextBlock &block,
const QPointF &offset,
const QVector<QTextLayout::FormatRange> &selections,
const QRect &clipRect) const
{
block.layout()->draw(painter, offset, selections, clipRect);
}
@RoyBellingan
RoyBellingan / patchFromUnixtimestamp3args.diff
Last active July 22, 2020 23:58
patchFromUnixtimestamp3args.diff
diff --git a/sql/item_create.cc b/sql/item_create.cc
index edf44fc3cd3..0d08224b237 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -36,7 +36,7 @@
#include "sql_time.h"
#include "sql_type_geom.h"
#include <mysql/plugin_function.h>
-
+#include "tztime.h"
#up autocomplete Suse like
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
@RoyBellingan
RoyBellingan / load.txt
Last active February 4, 2020 13:31
load.txt
1 [|||||||||||||||||||||||||||||||||||||| 61.4%] 13 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 25 [|||||||||||||||||||||||||||||||||||||||||| 67.7%] 37 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]
2 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 14 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 26 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 38 [|||||||||||||||||||||||||||||||||||||||||||||||||||| 84.1%]
3 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||99.4%] 15 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 27 [|||||||||||||||||||||||| 38.5%] 39 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]
4 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 16 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 28 [||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 40
@RoyBellingan
RoyBellingan / main.cpp
Created January 2, 2020 19:33
use the string
#include <QDebug>
#include <QMap>
#include <QByteArray>
class Something {
public:
QByteArray blob1;
int id2 = 0;
};
@RoyBellingan
RoyBellingan / main.cpp
Created January 2, 2020 19:25
QMap operator <
#include <QMap>
using namespace std;
class Something {
public:
string blob1;
int id2 = 0;
};
class Weird1 {
public: