export TKN=$(curl -X POST 'http://127.0.0.1:8080/realms/your-realm/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=your-user" \
-d 'password=your-pass' \
-d 'grant_type=password' \
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
package se.foo.bar; | |
import java.util.Optional; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import java.util.stream.Stream; | |
interface Either<L, R> { | |
<T> T either(Function<L, T> left, Function<R, T> right); |
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
import java.util.List; | |
import java.util.Objects; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
class Scratch { | |
public static void main(String[] args) { | |
System.out.println(getCertainThings()); |
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
alias resp='echo -e "\033]50;SetProfile=Default\a"' |
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 Movie { | |
enum Type { | |
REGULAR(PriceService::getRegularPrice), | |
NEW_RELEASE(PriceService::getNewReleasePrice), | |
CHILDREN(PriceService::getChildrensPrice); | |
public final BiFunction<PriceService, Integer, Double> priceAlgo; | |
private Type(BiFunction<PriceService, Integer, Double> priceService) { |
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
import sys | |
import logging | |
from .config import LOG_LEVEL | |
def setup_logging(): |
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
const I = x => x; | |
const K = x => y => x; | |
const A = f => x => f(x); | |
const T = x => f => f(x); | |
const W = f => x => f(x)(x); | |
const C = f => y => x => f(x)(y); | |
const B = f => g => x => f(g(x)); | |
const S = f => g => x => f(x)(g(x)); | |
const P = f => g => x => y => f(g(x))(g(y)); | |
const Y = f => (g => g(g))(g => f(x => g(g)(x))); |
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
const isThenable = val => | |
val | |
&& typeof val === 'object' | |
&& typeof val.then === 'function' | |
const map = fn => arg => | |
isThenable(arg) ? arg.then(fn) | |
: Array.isArray(arg) ? arg.map(fn) | |
: /* else */ ? fn(arg) |
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
const foo = a => | |
a === 1 ? 'one' | |
: a === 2 ? 'two' | |
: a === 3 ? 'three' | |
: /* else */ 'more' | |
const hello = foo => bar => | |
foo < bar ? foo * 2 | |
: foo > bar ? bar * 2 |
NewerOlder