Skip to content

Instantly share code, notes, and snippets.

View mikolasan's full-sized avatar
🌀
Fractal is almost compiled

Nikolay Neupokoev mikolasan

🌀
Fractal is almost compiled
View GitHub Profile
@mikolasan
mikolasan / HTML5_templates.groovy
Last active April 24, 2024 16:49
Jenkins pipelines for Godot
// Reference
// if you want LTO then the last supported emsdk = 3.1.18 https://github.com/godotengine/godot/issues/80010
def dockerFile = '''
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install --assume-yes --quiet \
build-essential \
pkg-config \
@mikolasan
mikolasan / README.md
Created November 27, 2023 22:24
Forgotten Standards Badge

Publish test results with this

@mikolasan
mikolasan / rtc_set_time_overflow.c
Created September 28, 2023 21:54
RTC set time overflow after January 1, 2070
// Compile:
// gcc -o test_ioctl_tm_struct test_ioctl_tm_struct.c
// Run on Linux:
// ./test_ioctl_tm_struct
// Expected output:
// RTC time set successfully.
//
// Actual result:
// Failed to set RTC time: Invalid argument
//
@mikolasan
mikolasan / lineage-15.1-ondevice-android-8.1
Created June 25, 2023 02:16
Nvidia Shield extracting proprietary files with extract-files.sh
Extracting 160 files in ./proprietary-files.txt from adb:
- /system/etc/hdcpsrm/hdcp1x.srm
- /system/etc/hdcpsrm/hdcp2x.srm
- /system/etc/hdcpsrm/hdcp2xtest.srm
- /system/vendor/bin/downloader
- /system/vendor/bin/glgps_nvidiaTegra2android
!! file not found in source
- /system/vendor/bin/gps_select.sh
!! file not found in source
- /system/vendor/bin/icera-switcherd
@mikolasan
mikolasan / README.md
Last active June 9, 2023 18:47
Memory handle examples

C++ MemoryHandle struct definition

Another process

Generate C++ code for the gRPC service

protoc --grpc_out=. --cpp_out=. memory.proto
@mikolasan
mikolasan / zhdun_base.py
Last active July 19, 2022 18:58
Python zhdun
from threading import Thread
from time import sleep
# globals
result = None
def result_will_be_soon():
sleep(1)
global result
@mikolasan
mikolasan / style-gan-1.py
Last active June 13, 2022 23:23
StyleGAN tutorial in Python interpreter
"""
https://www.tensorflow.org/tutorials/generative/cyclegan
pip install IPython tensorflow-rocm tensorflow_datasets matplotlib
pip install git+https://github.com/tensorflow/examples.git
"""
import tensorflow as tf
import tensorflow_datasets as tfds
@mikolasan
mikolasan / README.md
Created January 2, 2022 03:03
Simple Python TCP client

Simple Python TCP client

Features

  • nonblocking socket
  • server messages divided by a newline, broken packages concatenated before parsing
  • sending messages to server from standard input
  • reconnect timer
  • logger
@mikolasan
mikolasan / CMakeLists.txt
Created October 13, 2021 08:24
Getting started with rapidyaml
cmake_minimum_required(VERSION 3.14)
project(rapidyaml_getting_started VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(rapidyaml)
add_executable(test main.cpp)

C++ send UDP example

Copied code from Sending string over UDP in C++. C-style code in C++ question.

Let's make this solution to be a real C++ answer!

  • order of includes
  • char -> std string
  • int error code -> exceptions