Skip to content

Instantly share code, notes, and snippets.

View zethon's full-sized avatar
💯

Addy zethon

💯
View GitHub Profile
@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>
@zethon
zethon / spanish-phrases.txt
Last active April 2, 2024 11:47
Spanish Phrases
* En medio de todo eso... - In the middle of it all...
* Ni modo que me vaya a dormir - There is no way I am going to sleep.
* toma siesta - take a nap
* solicitud - request
* si alguna vez.. - if ever...
(e.g. si alguna vez te veo, te besara - if i ever see you, i will kiss you)
* No escuchaba nada de lo que le deciamos - He didn't listen to anything we told him.
* Podria correr el riesgo - I'll take that risk
(lit. I could run the risk)
* Ahora mismo - right now, this second