Skip to content

Instantly share code, notes, and snippets.

View elmot's full-sized avatar

Ilia Motornyi elmot

View GitHub Profile
@elmot
elmot / CMakeLists.txt
Created June 28, 2024 16:23
CMake project for STM32H7Sxx with multiple subprojects
# CMakeLists.txt for multi-project STM32H7Sxx MCUs and CLion IDE
#
# DISCLAIMER: Experimental version, based on undocumented assumptions how STM32CubeMX works
# DISCLAIMER: THIS FILE IS PROVIDED UNDER "The Unlicense" LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND
#
# Requirements:
# Toolchain binaries have to be in system path
# STM32CubeMX field "Project Manager | Code Generator | Target IDE" must be set to "STM32CubeIDE"
#
# Tested under environment:
@elmot
elmot / CMakeLists.txt
Created December 26, 2021 07:38
CMake project for STM32L5 with TrustZone enabled
# CMakeLists.txt for dual-core STM32L5xx MCUs and CLion IDE
#
# DISCLAIMER: Experimental version, based on undocumented assumptions how STM32CubeMX works
# DISCLAIMER: THIS FILE IS PROVIDED UNDER "The Unlicense" LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND
#
# Requirements:
# Toolchain binaries have to be in system path
# STM32CubeMX field "Project Manager | Code Generator | Target IDE" must be set to "STM32CubeIDE"
#
# Tested under environment:
@elmot
elmot / CMakeLists.txt
Last active September 9, 2024 11:50
CMake template for dual-core STM32 MCU
# CMakeLists.txt for dual-core STM32H7xx MCUs and CLion IDE
#
# DISCLAIMER: Experimental version, based on undocumented assumptions how STM32CubeMX works
# DISCLAIMER: THIS FILE IS PROVIDED UNDER "The Unlicense" LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND
#
# Requirements:
# Toolchain binaries have to be in system path
# STM32CubeMX field "Project Manager | Code Generator | Target IDE" must be set to "STM32CubeIDE"
#
# Tested under environment:
@elmot
elmot / CMakeLists.txt
Last active August 18, 2024 12:50
CMakeLists.txt template for ARM GCC projects
cmake_minimum_required(VERSION 3.17)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
# specify cross compilers and tools
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_AR arm-none-eabi-ar)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
@elmot
elmot / LocalizationExample.java
Created March 7, 2017 15:32
Vaadin 8: Locale-specific validation message example.
package com.vaadin.tests;
import com.vaadin.data.Binder;
import com.vaadin.data.ErrorMessageProvider;
import com.vaadin.data.HasValue;
import com.vaadin.data.ValueContext;
import com.vaadin.data.converter.StringToIntegerConverter;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.data.bean.Person;
import com.vaadin.ui.Button;
@elmot
elmot / HttpsFilter.java
Created January 24, 2017 23:03
Heroku - filter to redirect http requests to https
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class HttpsFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;