Skip to content

Instantly share code, notes, and snippets.

View Hc747's full-sized avatar
🤠
Waiting for builds to finish...

Harrison Cole Hc747

🤠
Waiting for builds to finish...
  • Australia
  • 18:01 (UTC +10:00)
View GitHub Profile
@Hc747
Hc747 / accounting.sql
Last active August 4, 2022 06:17 — forked from NYKevin/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
Flowable<Boolean> validate(String token) {
final Map<String, String> parameters = [secret: key(SECRET), response: token]
final HttpRequest<Map<String, String>> request = HttpRequest.POST(SITE_VERIFY_ENDPOINT, parameters).contentType(MediaType.APPLICATION_FORM_URLENCODED)
final Flowable<HttpResponse<Map<String, ?>>> exchange = http.exchange(request, Map.class) as Flowable<HttpResponse<Map<String, ?>>>
return exchange.map(response -> {
final Map<String, ?> body = response.body()
if (body == null) {
return false
}
return body.getOrDefault(KEY_SUCCESS, false)
{
"id": 000001,
"institution": "AU",
"module": "agency_information_form",
"title": "Agency information",
"components": [
{
"title": "Agency code",
"placeholder_text": "Agency code, please make sure the code is unique",
"input_type": "FREE_TEXT",
package au.edu.uac.apply.services
import au.edu.uac.agentportal.model.channel.InstitutionChannel
import grails.gorm.transactions.Transactional
import groovy.sql.GroovyRowResult
import groovy.sql.Sql
import java.util.concurrent.ConcurrentHashMap
import static grails.async.Promises.task
@Hc747
Hc747 / AppMain.groovy
Created August 22, 2019 12:04
Laura's Logbook Hours
import java.time.Duration
class AppMain {
static final def day_hours = [
[h:7, m:20],
[h:4, m:35],
[h:2, m:15],
[h:4, m:50],
[h:5, m:55],
{
"id":"UW",
"name":"University of Wollongong",
"locationGroups":[
{
"id":21,
"description":"Wollongong Campus",
"institution":"UW",
"locations":[
{
{
"id":"UW",
"name":"University of Wollongong",
"locationGroups":[
{
"id":21,
"description":"Wollongong Campus",
"institution":"UW",
"locations":[
{
{
"email_address": "harrisoncole05@gmail.com",
"recommendations_input_hash": "c108424f556b8f3e53630cda40d6b2637311ed8c47f40071715e464cf28a68d7",
"eligibility_input_hash": "89e44503fd455c990da10066637f9c3069bdeb69b9afb8ad4c1640ea0603fb8e",
"status": "INDETERMINATE",
"subjects": [
{
"subject_num": 15020,
"name": "Ancient History",
"code": "AHIST",
import io.netty.bootstrap.ServerBootstrap
import io.netty.channel.EventLoopGroup
import io.netty.channel.epoll.Epoll
import io.netty.channel.epoll.EpollEventLoopGroup
import io.netty.channel.epoll.EpollServerSocketChannel
import io.netty.channel.kqueue.KQueue
import io.netty.channel.kqueue.KQueueEventLoopGroup
import io.netty.channel.kqueue.KQueueServerSocketChannel
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.ServerSocketChannel
{
"email_address": "harrisoncole05@gmail.com",
"recommendations_input_hash": null,
"eligibility_input_hash": "eec27cb2d30ec8f6b2f9c853c6bb39ec8560378646eefd0e1e641e86345ac3eb",
"eligible": false,
"subjects": [
{
"subject_num": 15030,
"name": "Biology",
"code": "BIOLO",