Skip to content

Instantly share code, notes, and snippets.

@ghostbear
ghostbear / Spring Boot - Create your own native image without `bootBuildImage`
Created April 2, 2023 13:07
Spring Boot - Create your own native image without `bootBuildImage`
Simple `Dockerfile` script to generate a native image for a Spring Boot application
```dockerfile
FROM ghcr.io/graalvm/graalvm-ce:22.3.1 AS build
RUN microdnf install -y findutils
WORKDIR /app
COPY . ./
RUN ./gradlew nativeCompile
FROM ubuntu AS app

Bazel - How to add a newer version of Java

First find a JDK you want to use in Bazel, I will use Azul Zulu JDK 21 EA.

image

From the JDK vendor you choose you will need to find the download url and SHA256. In my case I find the download url by right clicking .zip and selecting Copy link address, and for the SHA256 I click the Checksum (SHA256) and copy the SHA256.

Now in your WORKFILE add the following

@ghostbear
ghostbear / GhostbearComposePreview.xml
Last active April 26, 2022 08:14
Code snippets to quickly test Compose Composables
<templateSet group="GhostbearComposePreview">
<template name="prew" value="@Preview(&#10; name = &quot;$NAME$&quot;,&#10; locale = &quot;$LANG$&quot;,&#10; showBackground = true,&#10; device = Devices.PIXEL_4_XL&#10;)&#10;@Composable&#10;fun preview$COMPONENT_NAME$() {&#10; $END$&#10;}" description="Create @Preview composable function" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="LANG" expression="" defaultValue="en" alwaysStopAt="false" />
<variable name="COMPONENT_NAME" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN" value="true" />
<option name="KOTLIN_COMMENT" value="false" />
</context>
</template>
@ghostbear
ghostbear / Spotify - How to reduce and limit the cache size (Windows - Mac).md
Last active April 9, 2024 11:07
[Spotify] How to limit the cache size (Windows/Mac OS)

Credit to MadHatter

WINDOWS

Use your text editor of choice or if you don't have one use Windows Notepad
Opening with Notepad may or may not result in a fancy mess

  1. Close Spotify
  2. Open File Explorer and paste the following into the address bar %appdata%/Spotify¤
  3. Open the file named prefs with your text editor
  4. Change the numeric value following storage.size= . If storage.size= doesn't exist add it manually to the end of the file and assign numeric value. This value represents megabytes. One gigabyte equals 1024 megabytes. In the end, it should look something like this storage.size=1024
  5. Save the file