Skip to content

Instantly share code, notes, and snippets.

View Mart-Bogdan's full-sized avatar
🤘
|m/

Bohdan Mart Mart-Bogdan

🤘
|m/
View GitHub Profile
@Mart-Bogdan
Mart-Bogdan / c_nostd.txt
Created May 29, 2023 19:09 — forked from tcoppex/c_nostd.txt
Writing C software without the standard library [Linux Edition] - Franc[e]sco's Gopherspace
###################################################################
Writing C software without the standard library
Linux Edition
###################################################################
There are many tutorials on the web that explain how to build a
simple hello world in C without the libc on AMD64, but most of them
stop there.
I will provide a more complete explanation that will allow you to
build yourself a little framework to write more complex programs.
@Mart-Bogdan
Mart-Bogdan / android-llama-alternatives.md
Created January 3, 2023 18:52 — forked from bmaupin/android-llama-alternatives.md
Alternatives to Llama for Android

Goal

Find a replacement for Llama (R.I.P. 😢)

Conclusion

🦙 Keep using Llama! 🦙

  • Llama still works and no other application seems to match Llama in terms of ease of use and cell-tower location (Llama's killer feature)
  • Cell-tower location UX seems to be unmatched by the alternatives (training new locations, ignoring towers, seeing location events)
@Mart-Bogdan
Mart-Bogdan / ksp_debugging.md
Created December 19, 2022 00:51 — forked from gotmachine/ksp_debugging.md
Debugging and profiling KSP plugins

This guide applies only to KSP 1.8 and latter. It covers modifying a KSP installation to allow :

  • In IDE debugging of KSP plugins by using breakpoints, inspecting runtime variables, doing step-by-step execution, etc. Both Visual Studio (including VS for Mac) and JetBrains Rider support debugging Unity games, and by extension KSP plugins.
  • Using the Unity editor profiling tools, which include great tools to measure and analyze CPU/GPU usage and memory allocations.

This guide is extensively tested for a Windows / Visual Studio scenario. However, it is theoretically possible to make all that work under MacOS or Linux, either with the Rider IDE or Visual Studio for Mac. This guide has limited details about those scenarios. I encourage you to leave a comment if you have additional information / experience.

Modifying KSP for profiling/debugging

Downloading the Unity editor

@Mart-Bogdan
Mart-Bogdan / md5chunks.py
Last active October 18, 2020 12:20 — forked from fmarani/md5chunks.py
calculate md5 hashes of chunks of a file, configurable block size
#!/usr/bin/env python
from optparse import OptionParser
from pathlib import Path
import hashlib
import sys
parser = OptionParser()
parser.add_option("-b", "--blocksize", dest="blocksize", type=int, default=1024,
help="Specify blocksize", metavar="blocksize")
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
import static enumeration.EnumerateWindows.Kernel32.*;
import static enumeration.EnumerateWindows.Psapi.*;
import static enumeration.EnumerateWindows.User32DLL.*;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.ptr.PointerByReference;
public class EnumerateWindows {
private static final int MAX_TITLE_LENGTH = 1024;
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.beans.value.*;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.input.*;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
using System;
using System.Collections;
class Example
{
public static void Main()
{
// Create a new hash table.
//
Hashtable openWith = new Hashtable();
1. Всем неподвижным объектам делаем свойство Static
2. Всем моделям в которых не используется анимация отменяем импорт анимации
3. Группы объектов позиционируем в коорд. (0,0,0).
4. Если необходимо смаштабировать
а) не пропорционально - делаем это в 3D редакторе, так как масштабы типа (1, 1.1, 2.5) создают дополнительный Draw Call
б) пропорционально - меняем масштаб в панели импорта модели.
5. По возможности все объекты держать а сцене в качестве префабов, кроме групп объектов(контейнеров)
6. Не делать из группы префабов новый префаб, так как связь элементов группы потеряется.
7. Проверять какие объекты должны отбрасывать/отражать тени, какие нет, так как по умолч. параметры Cast Shadows и Receive Shadows включенны.