Skip to content

Instantly share code, notes, and snippets.

View alexandersandberg's full-sized avatar
🚀
Building things

Alexander Sandberg alexandersandberg

🚀
Building things
View GitHub Profile
//
// ContentView.swift
// Playground
//
// Created by Alexander Sandberg on 23.03.24.
//
import SwiftUI
struct ContentView: View {
//
// TranslucentTitleBarApp.swift
// TranslucentTitleBar
//
// Created by Alexander Sandberg on 20.10.22.
//
import SwiftUI
@main
public extension Spacer {
static func maxHeight(_ value: CGFloat) -> some View {
Spacer(minLength: 0)
.frame(maxHeight: value)
.layoutPriority(-1)
}
static func maxWidth(_ value: CGFloat) -> some View {
Spacer(minLength: 0)
@alexandersandberg
alexandersandberg / axios.js
Last active November 4, 2019 14:28
Vue/Nuxt axios plugin with custom interceptors to retry a failed request due to expired tokens
import axios from 'axios'
export default function({ $axios, store }) {
$axios.onRequest((config) => {
const userAccessToken = store.state.auth.userAccessToken
if (userAccessToken) {
config.headers.common.Authorization = `Bearer ${userAccessToken}`
}
})
@alexandersandberg
alexandersandberg / setup-201904.jpg
Last active September 9, 2022 10:36
My setup equipment
setup-201904.jpg