This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CounterActivity: AppCompatActivity(), Enhancer<CounterState> { | |
private val store: Store<CounterState> by lazy { | |
Store( | |
CounterReducer(), | |
CounterState() | |
// applyMiddleware(...) | |
) | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CounterReducer: Reducer<CounterState> { | |
override fun reduce(state: CounterState, action: Action): CounterState { | |
return when (action) { | |
CounterAction.INCREASE -> state.copy(number = state.number + 1) | |
CounterAction.DECREASE -> state.copy(number = state.number - 1) | |
else -> state | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class CounterAction: Action { | |
object INCREASE: CounterAction() | |
object DECREASE: CounterAction() | |
companion object { | |
fun increaseAction(dispatch: Dispatch) = dispatch(INCREASE) | |
fun decreaseAction(dispatch: Dispatch) = dispatch(DECREASE) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class CounterState(val number: Int = 0): State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClientHttp { | |
static String BASE_HOST = "https://8days.localtunnel.me"; | |
private OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder(); | |
private Request.Builder requestBuilder = new Request.Builder(); | |
private HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); | |
private HttpUrl.Builder urlBuilder; | |
private Request request; | |
private OkHttpClient client; |
NewerOlder