- Go 1.22+,
net/http(http.ServeMux) sqlc(SQL-first)- Modular monolith
- Clean + Hexagonal + DDD-inspired
github.com/rluders/httpsuitefor HTTP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Polkadot Score Counter | |
| This Gist contains a self-contained Go program to calculate a "Polkadot score" from an ASCII art input. | |
| ## The Solution | |
| The program reads ASCII art from standard input and calculates a score based on the following logic: | |
| - It identifies a "lips" area, defined by a run of tildes (`~`) followed by an apostrophe (`'`). | |
| - It counts the number of 'O' characters that fall "inside" and "outside" this lips area. | |
| - It counts the number of "pupils", represented by `()` tokens. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package base62 | |
| // base62Chars is the Base62 alphabet. | |
| // Keeping it as a string is fine: it's immutable and indexable. | |
| const base62Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | |
| // Encode converts a uint64 number into a Base62-encoded string. | |
| func Encode(num uint64) string { | |
| // Special case: | |
| // If the input is 0, return the first character of the alphabet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // NOTE: | |
| // Revision 1 contains a much simpler and more idiomatic version of this program. | |
| // Revision 2 intentionally over-engineers the solution using an event bus and channels. | |
| // This revision exists mostly as a joke and as an experiment in architecture, not as | |
| // a recommendation for how to write small Go programs. | |
| package main | |
| import ( | |
| "bufio" | |
| "context" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Godot; | |
| using System; | |
| using System.Collections.Generic; | |
| /// <summary> | |
| /// Controls spawning and movement of a large number of units using Flow Field Navigation. | |
| /// </summary> | |
| public partial class ControlManager : Node | |
| { | |
| [Export] public PackedScene UnitScene; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // README: https://medium.com/@rluders/prepared-statement-caching-in-go-repositories-with-sqlx-a-professional-pattern-43a1fcdb7ed8 | |
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| _ "github.com/mattn/go-sqlite3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| ci = commit | |
| co = checkout | |
| cm = checkout master | |
| cb = checkout -b | |
| st = status -sb | |
| sf = show --name-only | |
| lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30 | |
| incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
| outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |
Angular Language Service
https://marketplace.visualstudio.com/items?itemName=Angular.ng-template
Angular2 Inline
https://marketplace.visualstudio.com/items?itemName=natewallace.angular2-inline
Angular2 Switcher
https://marketplace.visualstudio.com/items?itemName=infinity1207.angular2-switcher