This file contains hidden or 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 com.lithium.java8.chapter3; | |
import java.util.function.BiFunction; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.stream.Stream; | |
public class Advanced { | |
public static void main(String[] args) { |
This file contains hidden or 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
// get the crypto-js lib for hashing | |
var crypto = require('crypto-js'); | |
// get and check the validity of the api key | |
var apiKey = req.headers['x-auth-apikey']; | |
if (apiKey !== "<your expected api key>") { | |
console.log("invalid api key provided") | |
res.status(401).end(); | |
return; | |
} |
This file contains hidden or 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.time.Duration | |
class CallActionBuilder { | |
val actions: MutableList<CallAction> = mutableListOf() | |
fun answer() { | |
actions.add(AgentAnswer()) | |
} | |
fun pause(seconds: Long = 1) { | |
actions.add(Pause(Duration.ofSeconds(seconds))) |
OlderNewer