Skip to content

Instantly share code, notes, and snippets.

/*
* IRCodeGen.cpp
*
* Copyright © 2023 AeroJet Developers. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@nikomoravec
nikomoravec / mp3towav.c
Created September 24, 2023 17:15
cmp3towav
#define DR_MP3_IMPLEMENTATION
#include "dr_mp3.h"
#define DR_WAV_IMPLEMENTATION
#include "dr_wav.h"
#define EXIT_CODE_IO_EXCEPTION 1
#define EXIT_CODE_OK 0
int main(int argc, char** argv)
#ifndef OBSERVABLE_H
#define OBSERVABLE_H
#include <functional>
#include <vector>
template<typename T>
class observable
{
using delegateFunctor = std::function<void(const T& value)>;
#include <time.h>
typedef struct
{
time_t last_modified;
unsigned long long size;
unsigned char md5_checksumm[32];
char* compiled_from;
}java_class_file_header;
@nikomoravec
nikomoravec / Log.h
Created August 4, 2019 13:08
Simple C/C++ log macro
#ifndef LOG_H
#define LOG_H
#include <cstring>
#include <iostream>
#define LOGS_DISABLED 0
#define LOG_LEVEL_ERROR 1
#define LOG_LEVEL_INFO 2
#define LOG_LEVEL_DEBUG 3
# remove useless software after instalation
echo "removing gnome-software" && dnf remove gnome-software
echo "removing gnome-boxes" && dnf remove gnome-boxes
echo "removing gnome-weather" && dnf remove gnome-weather
echo "removing remove gnome-maps" && dnf remove gnome-maps
echo "removing cheese" && dnf remove cheese
echo "removing gnome-contacts" && dnf remove gnome-contacts
echo "removing libreoffice" && dnf remove remove libreoffice*
echo "removing evolution" && dnf remove remove evolution
echo "removing gcc" && dnf remove remove gcc
@nikomoravec
nikomoravec / Program.cs
Created February 6, 2018 16:24
Call private methods in C#
using System;
using System.Reflection;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
A a = new A();
@nikomoravec
nikomoravec / ClosestPairFromTwoSortedArrays.py
Created February 5, 2018 21:43
# We are given two arrays ar1[0…m-1] and ar2[0..n-1] and a number x, we need to find the pair ar1[i] + ar2[j] such that absolute value of (ar1[i] + ar2[j] – x) is minimum.
# We are given two arrays ar1[0…m-1] and ar2[0..n-1] and a number x, we need to find the pair ar1[i] + ar2[j] such
# that absolute value of (ar1[i] + ar2[j] – x) is minimum.
import math
def run():
a = [1, 4, 5, 7, 9, 11, 14] # first array
b = [10, 20, 30, 40, 45] # second array