Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️
Element -- selects all h2 elements on the page
h2 {| package com.pascaldimassimo.xyz; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import javax.persistence.EntityManagerFactory; | |
| import javax.sql.DataSource; | |
| import org.hibernate.cfg.ImprovedNamingStrategy; | |
| import org.springframework.beans.factory.annotation.Autowired; |
| @GrabConfig(systemClassLoader=true) | |
| @Grab(group='com.h2database', module='h2', version='1.3.176') | |
| import java.sql.* | |
| import groovy.sql.Sql | |
| import org.h2.jdbcx.JdbcConnectionPool | |
| println("More groovy...") | |
| def sql = Sql.newInstance("jdbc:h2:things", "sa", "sa", "org.h2.Driver") // DB files for 'things' in current directory (./hello.h2.db) |
Ratpack works very smoothly with spring-loaded library. It is defined as dependency in build.gradle file. Spring-loaded enables runtime hot class reloading.
dependencies {
springloaded "org.springframework:springloaded:1.2.0.RELEASE"
}
But default configuration reloads only changes in Ratpack.groovy file.
body {background:white;}
@media (prefers-color-scheme: dark) {
body {background:black; color:white;}
}see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
| /** | |
| * World's simplest express server | |
| * - used to serve index.html from /public | |
| */ | |
| var express = require('express'); | |
| var serveStatic = require('serve-static'); | |
| var app = express(); | |
| app.use(serveStatic(__dirname + '/public')); |
| /** | |
| * Encodes multi-byte Unicode string into utf-8 multiple single-byte characters | |
| * (BMP / basic multilingual plane only). | |
| * | |
| * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars. | |
| * | |
| * Can be achieved in JavaScript by unescape(encodeURIComponent(str)), | |
| * but this approach may be useful in other languages. | |
| * | |
| * @param {string} unicodeString - Unicode string to be encoded as UTF-8. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.