Skip to content

Instantly share code, notes, and snippets.

View vegaasen's full-sized avatar
🤠
Howdy

Vegard Aasen vegaasen

🤠
Howdy
View GitHub Profile
@vegaasen
vegaasen / signing-commits-github.md
Last active May 7, 2024 09:05
Add signature to github for existing SSH keys! 😁

How to /sign your commits by an existing SSH key

👋 Intro

Signing commits is useful for verifying that the commit is actually made by the source it says. Anyone can commit and give it any name and email address. Verification is a way to tell the difference between commits made by someone pretending to be us and commits we’ve actually made.

1. Set public key as an allowed signer

@vegaasen
vegaasen / NettyAccessLog.md
Last active November 1, 2023 15:08
Spring boot webflux and Micronaut netty access log config

Micronaut

application.conf-file

micronaut {
...
  server {
...
    netty {
@vegaasen
vegaasen / azure-swa-deploy.sh
Created June 29, 2022 05:39
Azure Static Web App (SWA) Deployer 🎉
#!/bin/bash
# In the future, when Azure fixes its `swa deploy build` command, we have to rely on this style (unfortunately)
# Whilst we're waiting for this to be fixed, lets rely on this script instead
apiTokenFile=.api-token
you=$(git config --get user.name)
theGitBranch=$(git branch --show-current)
theGitCommit=$(git rev-parse --short HEAD)
applicationName=$(pwd | awk -F/ '{print $NF}')
if [ ! "$(command -v swa)" ]; then
echo "💩⛔️ Oh no! No swa <command> found! Install this tool first using e.g npm i -g @azure/static-web-apps-cli"
@vegaasen
vegaasen / cypress-misc.md
Last active February 28, 2022 10:28
Cypress tips & tricks (configuration)

Cypress

This is just my ramblings regarding Cypress and ideas/tips/tricks that I've encountered during my days with this amazing tool 😁.

Parallelity?

Want parallel execution of your Cypress installation without using the default --parallel option? See below!

1. Add dependency for cypress-parallel

@vegaasen
vegaasen / react-retrofit-vite.md
Last active April 30, 2022 06:19
Retrofitting Vite in an React (CRA) application

Retrofitting Vite in an React (CRA) application

👋 hewwoww

This is just a quick introduction to migrating an existing web-app from a CRA => Vite. It doesn't solve all the problems you may have, but it gives a breif introduction to how to migrate. Also added a few points on stuff that went sideways for us whilst performing an migration 🤪.

🧾 Assumptions

This assumes the following:

@vegaasen
vegaasen / ResetLazy.kt
Last active October 27, 2021 06:11
Reset an Lazy-field in Kotlin
# What is this?
# Well..
# Sometimes you want to reset an val from a test where lazy props are being used.
# This helps you do just that.
# Amazing 🤩
# define the resetter 👇
import java.util.concurrent.atomic.AtomicReference
import kotlin.reflect.KProperty
@vegaasen
vegaasen / prettier-husky-hook.md
Last active September 28, 2021 06:31
Prettier + Husky + git-commit-hook + package.json on a separate folder

Problem 💥

I can't get Prettier, husky, git commit hooks working for my project, as I have my package.json in a separate folder!!!111!! WHAT TO DO?!?!!!

Example set-up:

  • package.json in a separate folder (say .frontend/package.json)
  • prettier installed
  • husky installed
  • pretty-quick installed
@vegaasen
vegaasen / maven-3.8.1-blocked-mirror.md
Last active April 29, 2024 01:40
Maven 3.8.1 blocked mirror for internal repositories

Maven 3.8.1 blocked mirrors "fix"

This is not a fix, but a workaround for repositories not on HTTPS yet. Use with caution.

Error

[ERROR] (...) Could not transfer artifact no.whatever:whatever-client:pom:3.1 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases (http://unportected.com/nexus/content/repositories/releases, defaul)] -> [Help 1]
@vegaasen
vegaasen / gradle-cheat-sheet.md
Last active December 1, 2021 12:10
Gradle Cheat Sheet

Gradle Cheat Sheet

Include details on which test that failed?

By default, gradle doesn't provide much information on which test that failed. This is something you can easily configure. Add the following configuration:

  test {
 useJUnitPlatform()
@vegaasen
vegaasen / svelte-cheat-sheed.md
Last active March 12, 2021 14:18
Svelte cheat sheet

Cheat Sheet

Testing

Svelte-navigator

# Mock it away!
jest.mock('svelte-navigator', () => ({useResolve: () => (jest.fn()), link: jest.fn()}));