In a Five Room Dungeon, the basic formula is:
- Entrance or Guardian
- Puzzle or Roleplaying Challenge
- Trick or Setback
- Climax, Big Battle, or Conflict
- Reward, Revelation, or Plot Twist
https://github.com/lf-edge/eve-libs/blob/main/reconciler/README.md | |
https://github.com/spotahome/gontroller |
// Gets the latest Apollo Embedded Sandbox Playground URL from the CDN S3 bucket | |
// | |
// To get the Subresource Integrity check, `go run main.go` and take what that outputs and run like this: | |
// CDN_FILE=https://embeddable-sandbox.cdn.apollographql.com/58165cf7452dbad480c7cb85e7acba085b3bac1d/embeddable-sandbox.umd.production.min.js | |
// curl -s $CDN_FILE | openssl dgst -sha256 -binary | openssl base64 -A; echo | |
package main | |
import ( | |
"encoding/xml" |
sqlc isn’t an ORM, but it implements one of the most useful features of one – mapping a query back into a struct without the need for boilerplate. If you have query with a SELECT * or RETURNING *, it knows which fields a table is supposed to have, and emits the result to a standard struct representing its records. All queries for a particular table that return its complete set of fields get to share the same output struct.
Rather than implement its own partially-complete SQL parser, sqlc uses PGAnalyze’s excellent pg_query_go, which bakes in the same query parser that Postgres really uses. It’s never given me trouble so far – even complex queries with unusual Postgres embellishments work.
This query parsing also gives you some additional pre-runtime code verification. It won’t protect you against logical bugs, but it won’t compile invalid SQL queries, which is a far shot better than the guarantees you get with SQL-in-Go-strings. And thanks to SQL’s declarative nature, it tends to produce fewer bugs than com
# See: https://olegk.dev/go-linters-configuration-the-right-version | |
run: | |
# Depends on your hardware, my laptop can survive 8 threads. | |
concurrency: 8 | |
# I really care about the result, so I'm fine to wait for it. | |
timeout: 30m | |
# Fail if the error was met. |
package main | |
import ( | |
"database/sql" | |
"database/sql/driver" | |
"fmt" | |
"net" | |
"os" | |
"time" |
package main | |
import ( | |
"fmt" | |
"testing" | |
"time" | |
"github.com/google/go-cmp/cmp" | |
"github.com/google/go-cmp/cmp/cmpopts" | |
"github.com/stretchr/testify/assert" |
// ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap | |
// ConsoleEncoder or Apex's CLI log | |
// The log format is designed to be human-readable. | |
// | |
// Performance can definitely be improved, however it's not my priority as | |
// this should only be used in development environment. | |
// | |
// e.g. log output: | |
// • ./main.go:21 Debug message {"hello":"world","!BADKEY":"bad kv"} | |
// ℹ ./main.go:217 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} |
RunParallel(t, TestCase{ | |
Steps: []TestStep{ | |
{ | |
Query: ` | |
query getWorksheet($id: ObjectId!) { | |
worksheet(id: $id) { | |
id | |
label | |
name | |
} |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"os" |