Skip to content

Instantly share code, notes, and snippets.

View romixch's full-sized avatar

Roman Schaller romixch

View GitHub Profile
@romixch
romixch / auth0-spa-js.tsx
Created February 5, 2020 21:33
Auth0: auth0-spa-js.js translated to Typescript
import React, { useState, useEffect, useContext, FC } from "react";
import createAuth0Client from "@auth0/auth0-spa-js";
interface Auth0ProviderProps {
children: JSX.Element;
auth0Options: Auth0ClientOptions;
onRedirectCallback: Function;
}
export interface Auth0ContextType {
@romixch
romixch / config manual.md
Last active November 13, 2019 15:56
Configure git for bitbucket.org and github.com

Bitbucket

Generate ID for bitbucket

ssh-keygen

By default, this is stored at ~/.ssh/id_rsa. Change this to ~/.ssh/bitbucket_id_rsa

Now configure ssh to use your bitbucket id when talking to bitbucket.org. Following text should go into ~/.ssh/config. If the file does not exist, create it:

@romixch
romixch / build.gradle.kts
Created October 27, 2019 20:52
Fix start script for windows generated by gradle application plugin
tasks.withType<CreateStartScripts>(CreateStartScripts::class.java) {
doLast {
var text = windowsScript.readText()
text = text.replaceFirst(Regex("(set CLASSPATH=%APP_HOME%\\\\lib\\\\).*"), "set CLASSPATH=%APP_HOME%\\\\lib\\\\*")
windowsScript.writeText(text)
}
}
@romixch
romixch / SessionApplication.kt
Created July 10, 2016 15:05
Demonstration how small a Spring Boot application with Kotlin can get.
package ch.romix.kotlin
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.hateoas.ResourceSupport
import org.springframework.hateoas.mvc.ControllerLinkBuilder.*
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping