Skip to content

Instantly share code, notes, and snippets.

View horatiu-udrea's full-sized avatar
🔗
Creating synergetic systems

Horațiu Udrea horatiu-udrea

🔗
Creating synergetic systems
View GitHub Profile
@horatiu-udrea
horatiu-udrea / Proposal.md
Last active March 6, 2021 08:20
AWS Infrastructure proposal.md

1. Initial considerations

Some of the services that AWS provides could help us drastically reduce the time needed for application configuration, maintenance and deployment.

2. Conditions and invariants

Most of our existing and upcoming applications:

  • Use a frontend static website written in Angular/TypeScript and a dockerized backend written in Django/Python
  • Are not optimized for serverless computing
@horatiu-udrea
horatiu-udrea / getField.java
Created March 22, 2020 17:28
Get a private Field from up the hierarchy
/**
* Returns the first {@link Field} in the hierarchy for the specified name
*/
private static Field getField(Class<?> clazz, String name) throws NoSuchFieldException
{
Field field = null;
while (clazz != null && field == null)
{
try
{
@horatiu-udrea
horatiu-udrea / ProgramUtils.java
Last active November 12, 2019 09:00
ToyLanguageInterpreter: Create a program from the given statements (unite them with CompundStatements)
public class ProgramUtils
{
private ProgramUtils()
{
}
public static List<Statement> generatePrograms()
{
return List.of(program());
}
@horatiu-udrea
horatiu-udrea / Qt.xml
Created June 13, 2019 19:34
CLion Live Templates for Qt framework (.CLion2019.1\config\templates\)
<templateSet group="Qt">
<template name="qtmake" value="cmake_minimum_required(VERSION 3.13)&#10;project($PROJECT_NAME$)&#10;&#10;set(CMAKE_CXX_STANDARD 14)&#10;set(CMAKE_AUTOMOC ON)&#10;set(CMAKE_AUTOUIC ON)&#10;set(CMAKE_AUTORCC ON)&#10;set(CMAKE_INCLUDE_CURRENT_DIR ON)&#10;&#10;file(GLOB headerFiles &quot;*.h&quot;)&#10;file(GLOB sourceFiles &quot;*.cpp&quot;)&#10;file(GLOB resourceFiles &quot;*.qrc&quot;)&#10;find_package(Qt5Widgets CONFIG REQUIRED)&#10;&#10;include_directories(${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_autogen/include)&#10;&#10;add_executable(${CMAKE_PROJECT_NAME}&#10; main.cpp&#10; ${sourceFiles}&#10; ${headerFiles}&#10; ${resourceFiles}&#10; )&#10;&#10;target_link_libraries(${CMAKE_PROJECT_NAME} Qt5::Widgets)" description="Qt project CMakeLists file" toReformat="true" toShortenFQNames="true">
<variable name="PROJECT_NAME" expression="" defaultValue="&quot;ProjectName&quot;" alwaysStopAt="true" />
<context>
<option name="CMAKE" v
@horatiu-udrea
horatiu-udrea / CMakeLists.txt
Last active June 13, 2019 16:17
CLion Qt configuration
cmake_minimum_required(VERSION 3.13)
project(TestProject)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
file(GLOB headerFiles "*.h")
@horatiu-udrea
horatiu-udrea / ExceptionHandler.java
Created May 25, 2018 12:22
Pro exception handler ;)
import java.awt.Desktop;
import java.net.URI;
public final class ExceptionHandler
{
private ExceptionHandler(){}
public static void handle(Exception e)
{
try