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 donkers.tutorial.medium | |
import org.junit.jupiter.api.Assertions | |
import org.junit.jupiter.api.Test | |
import org.junit.jupiter.api.TestInstance | |
import org.junit.jupiter.api.extension.ExtendWith | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.context.SpringBootTest | |
import org.springframework.boot.test.web.client.TestRestTemplate | |
import org.springframework.boot.web.server.LocalServerPort |
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 donkers.tutorial.medium | |
import org.junit.jupiter.api.Test | |
import org.springframework.boot.test.context.SpringBootTest | |
@SpringBootTest | |
class TutorialRestApiApplicationTests { | |
@Test | |
fun contextLoads() { |
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 donkers.tutorial.medium | |
import org.springframework.http.HttpStatus | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.RestController | |
import java.time.LocalDateTime | |
data class StatusObject(var timestamp:LocalDateTime, var message:String) { |
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 UIKit | |
extension UIApplication { | |
func _handleNonLaunchSpecificActions(arg1: AnyObject, forScene arg2: AnyObject, withTransitionContext arg3: AnyObject, completion completionHandler: () -> Void) { | |
//whatever you want to do in this catch | |
print("handleNonLaunchSpecificActions catched") | |
} | |
} |
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
#!/bin/bash | |
MUSER="$1" | |
MPASS="$2" | |
MDB="$3" | |
# Detect paths | |
MYSQL=$(which mysql) | |
AWK=$(which awk) | |
GREP=$(which grep) | |
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
function validate_ip(ipaddr) | |
{ | |
if (/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/.test(ipaddr)) | |
return true; | |
return false; | |
} | |
usage: | |
<script> |