Skip to content

Instantly share code, notes, and snippets.

View theol0403's full-sized avatar
💻

Theo Lemay theol0403

💻
View GitHub Profile
@theol0403
theol0403 / config.json
Created March 21, 2020 00:55
Windows terminal with materialshell scheme
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"profiles":
[
@theol0403
theol0403 / settings.json
Last active April 26, 2020 23:47
vscode
{
// "C_Cpp.autocomplete": "Disabled",
"C_Cpp.default.cStandard": "c99",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.errorSquiggles": "Disabled",
"C_Cpp.intelliSenseEngine": "Disabled",
"C_Cpp.autocomplete": "Disabled",
"C_Cpp.enhancedColorization": "Disabled",
"C_Cpp.updateChannel": "Insiders",
"cSpell.allowCompoundWords": true,
@theol0403
theol0403 / flywheel angler.cpp
Created May 7, 2020 20:18
flywheel control
/**
* Distance Control
*/
if(pDigital(DOWN)) {
robot.shooter->setDistanceToFlag(3.5_ft);
lastShootMacro = ShootController::shootMacros::off;
} else if(pDigital(LEFT)) {
robot.shooter->setDistanceToFlag(4.5_ft);
lastShootMacro = ShootController::shootMacros::off;
} else if(pDigital(UP)) {
@theol0403
theol0403 / init.vim
Last active July 6, 2020 00:50
My vimrc
"plugins
function! Cond(Cond, ...)
let opts = get(a:000, 0, {})
return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] })
endfunction
call plug#begin('~/.vim/plugged')
" essentials
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround' "ys{motion}{type} ds{type} cs{type} v_S{type}
# define NEW_RECORD(press) \
.event = { \
.key = {.col = 254, .row = 254}, \
.time = timer_read() | 1, \
.pressed = press, \
}
bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key_index, uint16_t keycode) {
// count the number of keys that were held down before
uint8_t count = __builtin_popcount(combo->state);
@theol0403
theol0403 / customOdometry.cpp
Last active December 8, 2021 22:18
lib7842 unit test demo
#include "lib7842/api/odometry/customOdometry.hpp"
#include <cmath>
namespace lib7842 {
CustomOdometry::CustomOdometry(std::shared_ptr<ChassisModel> imodel,
const ChassisScales& ichassisScales) :
model(std::move(imodel)), chassisScales(ichassisScales) {}
void CustomOdometry::setScales(const ChassisScales& ichassisScales) {
let axios = await require("@pipedreamhq/platform").axios;
function count(length) {
return Array.from({ length }, (_, i) => i + 1);
}
let days = count(7);
let hours = count(12);
let minutes = count(30);