Skip to content

Instantly share code, notes, and snippets.

View tombasche's full-sized avatar

Thomas Basche tombasche

  • Helsinki, Finland
View GitHub Profile
@tombasche
tombasche / CameraController.cs
Created December 9, 2023 08:25
cinemachine top down camera
using UnityEngine;
using Cinemachine;
public class CameraController : MonoBehaviour
{
[SerializeField] private CinemachineVirtualCamera cinemachineVirtualCamera;
private const float MIN_FOLLOW_Y_OFFSET = 2f;
private const float MAX_FOLLOW_Y_OFFSET = 12f;
@tombasche
tombasche / stringReverse.s
Last active April 1, 2022 09:42
Run in Spim or Mars to reverse a string with assembler! (MIPS)
# Mips program to reverse a string
# mips.s
.data
str: .space 128 # character buffer
.text
.globl main
@tombasche
tombasche / EmailTests.kt
Last active August 18, 2021 16:24
Sample test using localstack + testcontainers in Spring
package com.myapplication.email
import arrow.core.Either
import org.junit.jupiter.api.Assertions.fail
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.ActiveProfiles
import org.testcontainers.containers.localstack.LocalStackContainer
import org.testcontainers.utility.DockerImageName
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
@tombasche
tombasche / EmailClientConfiguration.kt
Last active August 18, 2021 16:20
SES Email client config + Sprint + Kotlin
package com.myapplication.email
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.ses.SesClient
@Configuration
class EmailClientConfiguration {
@tombasche
tombasche / EmailClient.kt
Created August 18, 2021 16:11
Basic email client using AWS SES + Spring + Kotlin
package com.myapplication.email
import arrow.core.Either
import org.springframework.stereotype.Component
import software.amazon.awssdk.services.ses.SesClient
import software.amazon.awssdk.services.ses.model.Body
import software.amazon.awssdk.services.ses.model.Content
import software.amazon.awssdk.services.ses.model.Destination
import software.amazon.awssdk.services.ses.model.Message
import software.amazon.awssdk.services.ses.model.SendEmailRequest
@tombasche
tombasche / SecurityConfig.kt
Last active August 11, 2021 15:36
Spring boot security config to allow preflight requests
import org.springframework.web.cors.CorsUtils
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
@Configuration
class SecurityConfig : WebSecurityConfigurerAdapter() {
override fun configure(http: HttpSecurity) {
http
.authorizeRequests()
@tombasche
tombasche / WebServerConfiguration.kt
Created August 11, 2021 15:14
Spring boot (kotlin) Web Server Config for CORS
package com.myapplication
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
class WebServerConfiguration {
@tombasche
tombasche / devopsreading.md
Last active March 29, 2021 17:26
DevOps Reading List

Books to read to learn DevOps

  • The DevOps Handbook - Kim, Humble, Debois, Willis, Allspaw

  • The Phoenix Project - Gene Kim

  • The Unicorn Project - Gene Kim

  • Reinventing Organisations - Frederic Laloux

@tombasche
tombasche / csa_notes.md
Last active March 29, 2021 14:54
AWS CSA Notes

AWS SA Exam Tips

General

What hypervisor does EC2 use?

  • Nitro (was 'Xen')

What are the different virtualization types?

  • HVM
  • PV

AWS SysOps Exam Tips

Monitoring

Cloudwatch

  • What are the default host-level metrics for EC2?
    • CPU
    • Network
  • Disk