Skip to content

Instantly share code, notes, and snippets.

View Tropix126's full-sized avatar
🌴

Tropical Tropix126

🌴
View GitHub Profile
@Tropix126
Tropix126 / mtp.cpp
Last active April 13, 2024 19:15
Small demonstration of the move-to-point motion algorithm.
/**
* Given a left, right, and maximum speed, calculate a new set of speed values that preserve the
* ratio between left and right if one of the two values is over the maximum threshold.
*
* @param left_speed The uncapped left speed.
* @param right_speed The uncapped right speed.
* @param max_speed The maximum speed that can be reached by a motor.
*
* @return A pair of speed values {left_speed, right_speed} that is correctly scaled down if one
* of the two values exceeds max_speed.

Hot/Cold Linking

Hot/cold linking is a strategy used by PROS for splitting a program into two binary packages to reduce upload size.

  • The cold image (cold.bin) contains libraries (libpros, liblvgl, libstdc++, etc...). The cold image is uploaded once, or whenever it is modified.
  • The hot image (hot.bin) contains user functions and links against the cold image. The hot image is uploaded every time the program is built, and thus must be optimized for size.

Memory

Each image has its own address offset in memory:

@Tropix126
Tropix126 / layout.md
Last active June 18, 2023 17:19
Random Layout Model

Layout System

Just jotting down some ideas. Inspired by flexbox, Morphorm, and Figma's autolayout engine.

TODO: Consider RTL/writing modes

  • This is currently okay on most properties excluding offsets, paddings and margins.
  • This would require no usage of absolute directions (top/bottom/left/right).

Common Units

  • Pixels are a unit of length defined by a logical pixel.
  • Percent is a relative unit of length defined by the computed dimensions of an anchor element (usually a parent, although see position for edge cases) excluding padding.
@Tropix126
Tropix126 / layout.md
Created June 18, 2023 13:17
Random Layout Model

Layout System

Just jotting down some ideas. Inspired by flexbox, Morphorm, and Figma's autolayout engine.

TODO: Consider RTL/writing modes

  • This is currently okay
  • This would require no usage of absolute directions (top/bottom/left/right).

Common Units

  • Pixels are a unit of length defined by a logical pixel.
  • Percent is a relative unit of length defined by the computed dimensions of an anchor element (usually a parent, although see position for edge cases).
@Tropix126
Tropix126 / list.md
Created December 31, 2021 04:24
List of style resolving bundler plugins.
@Tropix126
Tropix126 / discord.css
Last active February 6, 2020 01:33
Makes less of an eyesore
@import url("https://masicorelord.github.io/Mini-Themes/OldRegularMessageDividers.css");
.container-3FojY8 .markup-2BOw-j:not(.embedFull-2tM8--) {max-width:calc(100% - 70px);}
:root {--background-message-hover:transparent;}
.button-1ZiXG9,
.separator-42rNt0 {
display:none;
}
.mentioned-xhSam7 {
background-color:transparent !important;
}
@Tropix126
Tropix126 / template.css
Last active September 3, 2021 20:58
redGuilds Fix
//META{"name":"redGuilds","description":"Changes the guilds background to red","author":"Jiiks","version":"1.0"}*//
.guilds-1SWlCJ .scroller-2TZvBN {
background:red;
}