Skip to content

Instantly share code, notes, and snippets.

View SteelPh0enix's full-sized avatar
🅱️
yeet

Wojciech Olech SteelPh0enix

🅱️
yeet
View GitHub Profile
#include <iostream>
#include <string>
template <typename T>
class Container {
public:
// Prevents creating nameless objects without value - assume that these are invalid.
Container() = delete;
#![no_std]
#![no_main]
use cortex_m_rt::entry;
use cortex_m_semihosting::hprintln;
use panic_semihosting as _;
use stm32f4::stm32f401::Peripherals;
fn init_board() -> Peripherals {
@SteelPh0enix
SteelPh0enix / init.lua
Last active February 2, 2023 17:14
My neovim init script
-- disable netrw (nvim-tree)
-- vim.g.loaded_netrw = 1
-- vim.g.loaded_netrwPlugin = 1
-- change shell
vim.o.shell = 'zsh -i'
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
@SteelPh0enix
SteelPh0enix / generate_wav.cpp
Last active November 12, 2022 22:23
Generate simple WAV audio file in C++
#include <algorithm>
#include <array>
#include <cinttypes>
#include <cmath>
#include <fstream>
#include <iostream>
#include <string_view>
#include <vector>
#include "wav_header.hpp"
@SteelPh0enix
SteelPh0enix / .vimrc
Created October 11, 2022 11:29
My current .vimrc file
" vimrc based on https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" written by SteelPh0enix
" Set how many lines of history are remembered
set history=500
" Enable filetype plugins
filetype plugin on
filetype indent on
@SteelPh0enix
SteelPh0enix / kalman_filter.py
Last active July 22, 2022 14:31
Simple 1D Kalman filter implementation
from dataclasses import dataclass
import pandas as pd
@dataclass
class KalmanFilterUpdateResult:
time_point: float
gain: float
previous_state: float
current_state: float
[{"id":"7e9c50ed.2ab67","type":"subflow","name":"Group variables in a .csv file","info":"","category":"STMicroelectronics","in":[{"x":60,"y":80,"wires":[{"id":"c7f149ae.894818"}]}],"out":[{"x":840,"y":360,"wires":[{"id":"802c75f2.9f7898","port":0}]}],"env":[{"name":"nbVar","type":"num","value":"","ui":{"icon":"font-awesome/fa-cogs","label":{"en-US":"Number of Variables"},"type":"input","opts":{"types":["num"]}}},{"name":"delete_time","type":"bool","value":"false","ui":{"icon":"font-awesome/fa-clock-o","label":{"en-US":"Single Time"},"type":"input","opts":{"types":["bool"]}}}],"color":"#3CB4E6","icon":"node-red/join.svg"},{"id":"7b54efc3.0009e","type":"function","z":"7e9c50ed.2ab67","name":"Associate values with same timestamp","func":"let i = 0;\nlet j = 0;\nlet n = 0;\nlet msg1; \nlet msgArray = new Array();\nlet nbVar = msg.payload.length;\n\nfor(i = 0; i < nbVar; i++){\n \n let underArrayLength = msg.payload[i].length;\n \n for(j = 0; j < underArrayLength; j++){\n \n for(n
#include <avr/interrupt.h>
#include <avr/io.h>
#include <util/delay.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#define _NOP() \
do { \
@SteelPh0enix
SteelPh0enix / list_processes.cpp
Last active April 13, 2022 07:58
List Windows processes alphabetically
#include <Windows.h>
#include <Psapi.h>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#ifdef UNICODE
using String = std::wstring;
@SteelPh0enix
SteelPh0enix / Main.kt
Last active April 7, 2022 17:43
how to get checkbox in jtable using kotlin
import javax.swing.UIManager
fun main(args: Array<String>) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
val ui = UIController()
ui.createAndShowUI()
}