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
const echoPostRequest = { | |
url: 'https://cognito-idp.eu-central-1.amazonaws.com/', | |
method: 'POST', | |
header: { | |
'Content-Type': 'application/x-amz-json-1.1', | |
'X-Amz-Target': 'AWSCognitoIdentityProviderService.InitiateAuth' | |
}, | |
body: { | |
mode: 'application/json', | |
raw: JSON.stringify( |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: > | |
Constructs a managed IAM policy to deploy a serverless project. | |
This template assumes the stack is being deployed in the current region and account. | |
You can then attach this policy to other IAM objects, such as users or roles. | |
Based on the work done in: https://github.com/serverless/serverless/issues/1439 |
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
#!/usr/bin/env groovy | |
/** | |
* notify slack and set message based on build status | |
*/ | |
import net.sf.json.JSONArray; | |
import net.sf.json.JSONObject; | |
import hudson.tasks.test.AbstractTestResultAction; | |
import hudson.model.Actionable; |
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
@Bean | |
public JwtParser jwtParser() | |
{ | |
Security.addProvider(new BouncyCastleProvider()); | |
final X509EncodedKeySpec spec = new X509EncodedKeySpec(Base64.getUrlDecoder().decode(PUBLIC_KEY)); | |
final KeyFactory factory; | |
try { | |
factory = KeyFactory.getInstance("ECDSA", "BC"); | |
final PublicKey publicKey = factory.generatePublic(spec); |
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 | |
set -e | |
JAVA_HOME=${1-text} | |
[ $# -eq 0 ] && { echo "Usage: sudo $0 \$(/usr/libexec/java_home -v '1.8*')" ; exit 1; } | |
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts | |
wget https://letsencrypt.org/certs/isrgrootx1.der | |
wget https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der |
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
@Bean | |
public EmbeddedServletContainerFactory servletContainer() { | |
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() { | |
@Override | |
protected void postProcessContext(Context context) { | |
SecurityConstraint securityConstraint = new SecurityConstraint(); | |
securityConstraint.setUserConstraint("CONFIDENTIAL"); | |
SecurityCollection collection = new SecurityCollection(); | |
collection.addPattern("/*"); | |
securityConstraint.addCollection(collection); |
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 be.ibizz.bluenote; | |
import org.springframework.data.mongodb.repository.MongoRepository; | |
public interface NotesRepository extends MongoRepository<Note, Long> { | |
} |
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
@RestController | |
public class LinkController { | |
private LinkService linkService; | |
@Autowired | |
public LinkController(LinkService linkService) { | |
this.linkService = linkService; | |
} | |
@RequestMapping("/links") |
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 (angular) { | |
'use strict'; | |
angular | |
.module('linkApp') | |
.controller('LinkController', ['$scope', '$log', 'LinkService', function LinkController($scope, $log, LinkService) { | |
$scope.longUrl = null; | |
$scope.link = null; | |
$scope.shorten = function (url) { |
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
<!DOCTYPE html> | |
<html xmlns:th="http://www.thymeleaf.org" lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/> | |
<title>opt.is linkshortener</title> | |
<link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.1/css/bootstrap.min.css" | |
th:href="@{/webjars/bootstrap/3.3.1/css/bootstrap.min.css}" rel="stylesheet" media="screen"/> |
NewerOlder