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
alias nx='/bin/bash ~/.scripts/nx.sh' # NginX scripts |
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
@ControllerAdvice | |
public class NotFoundHandler { | |
@Value("${spa.default-file}") | |
String defaultFile; | |
@ExceptionHandler(NoHandlerFoundException.class) | |
public ResponseEntity<String> renderDefaultPage() { | |
try { | |
File indexFile = ResourceUtils.getFile(defaultFile); | |
FileInputStream inputStream = new FileInputStream(indexFile); |
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
@Configuration | |
public class MvcConfig implements WebMvcConfigurer { | |
@Value("${spring.resources.static-locations}") | |
String resourceLocations; | |
@Override | |
public void addResourceHandlers(ResourceHandlerRegistry registry) { | |
registry.addResourceHandler("/public/**").addResourceLocations(resourceLocations); | |
} | |
} |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Spring Boot</title> | |
</head> | |
<body> | |
<h1>Served as a static file.</h1> | |
</body> | |
</html> |
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
<iron-pages selected="[[selected]]"> | |
<home-page name="home"></home-page> | |
<contacts-page name="contacts"></contacts-page> | |
<admin-page name="admin"></admin-page> | |
</iron-pages> | |
<script> | |
// ...Polymer boilerplate | |
{ | |
properties: { |
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.security.MessageDigest | |
String fileContents = "<html><head></head><body>Hello world!</body></html>" | |
MessageDigest sha = MessageDigest.getInstance("MD5") | |
byte[] digest = sha.digest(fileContents.bytes) | |
print "${digest.encodeHex()}" |
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
// Forms | |
// <form is="data-form" action="/users" model="[[user]]" busy="{{sending}}" id="login"> | |
// ... | |
// <input type="submit" value="Log In" disabled$="[[sending]]" /> | |
// </form> | |
// this.$.login.validate() | |
// this.$.login.send().then().catch() | |
var Form = { | |
extends: 'form', |
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
| id | name | email | permissions | | |
|----|-------|----------------|--------------------| | |
| 1 | kevin | [email protected] | basic,manage_posts | |
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
'use strict'; | |
var textarea = document.querySelector('#ghostdown-editor'), | |
preview = document.querySelector('#ghostdown-rendered'), | |
converter = new showdown.Converter(), | |
editor = CodeMirror.fromTextArea(textarea, { | |
mode: 'markdown', | |
tabMode: 'indent', | |
lineWrapping: true | |
}); |
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
var gulp = require("gulp"); | |
var bundler = require('aurelia-bundler'); | |
var del = require("del"); | |
var aureliaBundle = { | |
"includes": [ | |
"aurelia-auth", | |
"aurelia-bootstrapper", | |
"aurelia-event-aggregator", | |
"aurelia-fetch-client", |
NewerOlder