Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

112 total results found

Markdown CheatSheet

Cheat Sheets

Basic Syntax These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements. Refenced from here: click Syntax Description Heading # H1 ##H2 ### H3 Bold **bold text** Italic *italicized ...

OpenAPI V3.0 Syntax CheatSheet

Cheat Sheets

OpenApi 3.0 specification in Yaml format contents can be written in separate files, and referenced with $ref: "./schemas/User.yaml" syntax Example: # Version of the openapi specificaiton openapi: 3.0.0 # General metadata about this app info: version: 1.0.0...

GORM CheatSheet

Cheat Sheets Database

Import import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/gorm" ) func main() { // MYSQL: // refer https://github.com/go-sql-driver/mysql#dsn-data-source-name for details dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4...

Golang CheatSheet

Cheat Sheets

Zero Values integer: 0 float: 0.0 boolean: false strings: "" channel, map, slice, pointer, function, interface: nil // MD5 hashing example: import ( "crypto/md5" "encoding/hex" ) func GetMD5Hash(text string) string { hasher := md5.New() ...

Proto3 CheatSheet

Cheat Sheets

Why Protocol Buffers? Protocol buffers are Google's language-independent, platform-independent, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then y...

PostgreSQL CheatSheet

Cheat Sheets Database

PostgreSQL is: open sourced supports both relational and non-relational (JSON) queries for dynamic websites and web applications Why are there schemas in each database? To better organize tables, create modules, and use RBAC Public is the default schema Som...

Inheritance Pattern

MongoDB Basic Schema Design Patterns

To apply the Inheritance Pattern to documents in a collection, you can use the aggregation framework. This first example updates all book documents with a new “product type” field to identify the shape of the ebook, printed book, and audiobook documents. The p...

Finance

Cheat Sheets Finances

ISO 20022 a international standard for communication in financial systems. widely adopted by financial institutes world wide clear standardized format, efficient, real-time processing (RTP), flexible, example: <Document> <CstmrCdtTrf> <GrpHdr> <M...

Don't Communicate by Sharing Memory, Share Memory by Communicating

Golang Advanced Golang

Mutex

Cheat Sheets Fundamentals

What is it mutual exclusion a synchronization primitive used in concurrent programming to ensure that only one thread can access a shared resource at a time How it works Locking: a thread that needs to access a sahred resource acquires the mutex lock if th...

Goroutine

Golang Advanced Golang

Goroutines are not threads The Go runtime efficiently manages a pool of OS threads to execute many goroutines. It intelligently schedules goroutines onto these threads, switching between them as needed. This multiplexing allows for highly concurrent applicat...

Concurrency vs Parallelism

Golang Advanced Golang

Computed Pattern

MongoDB Basic Schema Design Patterns

Use Case: running a function frequently degrade performance, for example: calculate the average rating whenever a new review is submitted. Mathematical Operation: store avg and # of reviews. then update the rating: (avg_rating * #reviews + new_rating) / (#r...

Approximation Pattern

MongoDB Basic Schema Design Patterns

When data is changing constantly, and exact statistic is not critical, we can use approximations with a decent level of accuracy.

Extended Reference Pattern

MongoDB Basic Schema Design Patterns

Joins are expensive so store some must have data into the child to avoid joins. This creates data duplicate, yes, but it's an expense we can pay in exchange for performance. Duplicated data should not change frequently in nature. If data needs to be updated, ...

Schema Versioning Pattern

MongoDB Basic Schema Design Patterns

add a schema_version field to the document To Handle multiple versions: application handles both old and new version run a background task to update all documents to new version once migrated to new verion, remove code that handles old version

Single Collection Pattern

MongoDB Advanced Schema Design Patterns

The single collection pattern groups related documents of different types into a single collection use case: many to many relationships one to many relationship catalog of product items shopping carts variant1: books, users, reviews docType field and rel...

Subset Pattern

MongoDB Advanced Schema Design Patterns

a book have N reviews only embed 3 reviews to the book Code Summary: Subset Pattern To apply the Subset pattern to the documents in our bookstore app, we ran the following aggregation pipeline: use("bookstore"); const copyReviews = [ { // TODO: Specify...

Bucket Pattern

MongoDB Advanced Schema Design Patterns

The bucket pattern: groups pieces of information into buckets keep documents size predictable read only data we need reduce number of documents in a collection improve index performance Example: track user views per book each view needs: user_id, book_id, t...

Outlier Pattern

MongoDB Advanced Schema Design Patterns

used when some documents are different and needs a different method to interact. example: most of books have a single digit reviews, so embeded method is used. but one or two hot sales have lots of reviews, so reference method needs to be used. Code Summary: O...