Skip to content

Instantly share code, notes, and snippets.

View zethon's full-sized avatar
💯

Addy zethon

💯
View GitHub Profile
@zethon
zethon / test.cp
Last active April 20, 2024 14:40
#include <iostream>
#include <string>
// Requirements:
// * get and set employees first name and last name
// * get and set employees manager
// * get and set employees salary
// * function that returns full name
// * function that prints all known/set info about employee
// * function that gives a raise to an employee, not above 25%
@zethon
zethon / sample.qml
Last active November 23, 2023 01:34
QML Popup Transition
import QtQuick.Window 2.2
// import QtQuick.Controls 2.12
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.3
ApplicationWindow {

NPM error with installing dependencies:

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz failed, reason: unable to get local issuer certificate

Fixed with:

@zethon
zethon / gist:6b7470b4f3a1df9618fc5151a4fbbcf2
Created January 9, 2022 13:16
Redirect CMake output to file
cmake ... >> output_file.txt 2>&1
@zethon
zethon / snippet.yml
Created June 26, 2021 23:52
Github Actions Ubuntu Install GCC-11
- name: Install GCC11
shell: bash
run: |
sudo apt update
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
@zethon
zethon / iterator.cpp
Created June 22, 2021 13:26
Writing a Custom Iterator for a Container with Ephemeral Objects
#include <iostream>
#include <string>
#include <vector>
#include <memory>
class Database
{
std::vector<int> _data;
public:
@zethon
zethon / file.cpp
Created December 19, 2020 02:47
C++ Cumulative Moving Average Class
template<typename NumberT>
class CumulativeMovingAverage
{
NumberT _total = 0;
std::size_t _count = 0;
public:
float value() const
{
// TODO: pretty sure only one cast is need, but not 100% sure
@zethon
zethon / swedish-words.txt
Last active October 1, 2020 11:57
Swedish Words
igen - again
arr - is
jag har ett träd på mitt hus - I have a tree on my house
// Alternate answer to: https://stackoverflow.com/questions/63643025/lua-5-2-sandboxing-in-different-objects-with-c-api
#include <string>
#include <cassert>
#include <iostream>
#include <lua/lua.hpp>
#include <fmt/format.h>