Skip to content

Instantly share code, notes, and snippets.

View BioBoost's full-sized avatar

Nico De Witte BioBoost

  • VIVES University
  • Belgium
View GitHub Profile
@BioBoost
BioBoost / openssl.conf
Created August 28, 2023 19:01 — forked from andrewconnell/openssl.conf
OpenSSL configuration file that uses Alternate Names & Subject Alternate Names
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
# The Subject DN can be formed using X501 or RFC 4514 (see RFC 4519 for a description).
# Its sort of a mashup. For example, RFC 4514 does not provide emailAddress.
@BioBoost
BioBoost / cpp_render_interface.h
Created December 21, 2022 09:33
Rendering interface c++
class IRender {
virtual void render(Canvas *canvas) = 0;
};
///////////////////////////////////////////////////
class SenseHatRenderer : public IRender {
void render(Canvas * canvas) override {
// ....
@BioBoost
BioBoost / std_array_buffer.cpp
Created October 26, 2022 10:27
Using std::array as 2d buffer
#include <iostream>
#include <array>
#include <string>
using namespace std;
int main() {
cout << "Demo std::array" << endl;
@BioBoost
BioBoost / ANSI.md
Created October 25, 2022 18:13 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@BioBoost
BioBoost / joystick.c
Created June 9, 2022 05:51 — forked from jasonwhite/joystick.c
Reads joystick/gamepad events on Linux and displays them.
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
@BioBoost
BioBoost / arrays-reactivity.md
Last active November 19, 2020 09:33
Arrays and Reactivity in Vue
@BioBoost
BioBoost / Include-in-Sequelize.md
Created October 28, 2020 12:55 — forked from zcaceres/Include-in-Sequelize.md
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@BioBoost
BioBoost / main.cpp
Created March 10, 2019 18:29
C++ Hello World
#include <iostream>
using namespace std;
int main() {
cout << "Hello World from C++" << endl;
return 0;
}
@BioBoost
BioBoost / tasks.json
Created February 11, 2019 14:27
VSCode Simple C++ Tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "run app",
"type": "shell",
"command": "${workspaceFolder}/app.exe",
"args": [],
"group": {
"kind": "build",