Skip to content

Instantly share code, notes, and snippets.

View zachpendleton's full-sized avatar

Zach Pendleton zachpendleton

View GitHub Profile
apply plugin: 'java-library'
dependencies {
annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor:2.5.2'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.5.2'
implementation 'org.springframework.boot:spring-boot-starter:2.5.2'
api project(':multi-module-greeter')
}
allprojects {
apply plugin: 'java'
group 'com.instructure'
version '0.0-SNAPSHOT'
repositories {
mavenCentral()
}
package com.example.demo.actuator;
import com.example.demo.model.Course;
import com.example.demo.repository.CoursesRepository;
import java.util.List;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>
package com.example.demo.repository;
import static com.example.demo.generated.jooq.Tables.COURSES;
import com.example.demo.generated.jooq.tables.records.CoursesRecord;
import com.example.demo.model.Course;
import com.example.demo.model.Course.Visibility;
import java.util.List;
import java.util.Optional;
import org.jooq.DSLContext;
CREATE TABLE courses (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
name TEXT NOT NULL,
start_at TIMESTAMPTZ,
visibility TEXT NOT NULL DEFAULT 'VISIBLE',
seats INT NOT NULL DEFAULT 0,
enrollment_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ
)
plugins {
id 'org.springframework.boot' version '2.5.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '16'
---
version: "3.8"
services:
postgres:
image: postgres:alpine
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: course_catalog
POSTGRES_DB: course_catalog_development
ports:
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.14.0.xsd">
<!-- Configure the database connection here -->
<jdbc>
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@[your jdbc connection parameters]</url>
<user>[your database user]</user>
<password>[your database password]</password>
<!-- You can also pass user/password and other JDBC properties in the optional properties tag: -->
<properties>
@zachpendleton
zachpendleton / calculator.txt
Created June 23, 2021 10:45
calculator.txt
This file has been truncated, but you can view the full file.
8b5b831b616e6b52d767fda9bc2bece3ed215eb6,+ 7400 33596
a57aa7cf196bed3ae71ccc9c6caf1742b32e89c5,! 4068
6f6b1ebc11e603338ff2236a9987dbc016f19862,! 4733
420069bf77a9b7f6ad5a081549e5053f712b8685,+ 48080 19645
2112b2e9c2014d076b871c8bb7702778e626035d,! 2852
4b8a910453a91d2c73db2b6330992a2bada83e2a,/ 28269 40744
d5070aabb1c27ac80e4c6028d253e767b474ade6,! 188
e3186f2dbb2fc78f778ec34949504c1860c08af0,! 3833
87c9fac35b35111fe3b34dda10dcfe1a16b4facd,* 18344 3157
632cb9391c7494cf5309209b05a46f359c72d971,! 2906