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
| """ | |
| Defines the Django views for an example search and user list API. | |
| This module contains view functions that handle HTTP requests. It follows a | |
| service-layer architecture, where views are responsible for: | |
| - Handling HTTP-specific concerns (parsing requests, forming responses). | |
| - Validating input using Pydantic schemas. | |
| - Orchestrating calls to the business logic layer (services). | |
| - Handling exceptions and rendering appropriate templates or JSON responses. | |
| """ |
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
| """ | |
| Defines the Flask endpoints for an example search and user list API. | |
| This module contains the view functions that handle HTTP requests for searching | |
| documents and managing user-specific lists. It follows the Application Factory | |
| pattern, where endpoints are registered on a Blueprint, which is then attached | |
| to the main Flask app instance. | |
| Responsibilities: | |
| - Defining URL routes and accepted HTTP methods. |
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 main | |
| // Assumes a directory next to this file called "templates" | |
| // containing "home.html", "forest.html" | |
| import ( | |
| "embed" | |
| "fmt" | |
| "html/template" | |
| "io" |
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 main | |
| import ( | |
| "fmt" | |
| "maps" | |
| "os" | |
| "regexp" | |
| "slices" | |
| "strings" | |
| "time" |
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
| // 09 January 2025 | |
| package main | |
| import ( | |
| "cmp" | |
| "fmt" | |
| "slices" | |
| "sort" | |
| "time" | |
| ) |
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 main | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/charmbracelet/bubbles/list" | |
| tea "github.com/charmbracelet/bubbletea" | |
| "github.com/charmbracelet/lipgloss" | |
| ) |
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 main | |
| import ( | |
| "context" | |
| "database/sql" | |
| "fmt" | |
| _ "github.com/lib/pq" | |
| ) |
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
| /* | |
| Check the certificates loaded into the specified ssh agent for imminent expiry | |
| example output: | |
| 0 key ssh-ed25519 : is not a certificate | |
| 1 key ssh-ed25519-cert-v01@openssh.com | |
| comment: acmeinc_briony_from:2023-03-07T08:18_to:2023-03-07T11:18UTC | |
| validity: 2023-03-07 08:37:23 GMT to 2023-03-07 11:37:23 GMT | |
| expiring in 60m? true |
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 main | |
| import ( | |
| "crypto/ed25519" | |
| "crypto/x509" | |
| "fmt" | |
| "time" | |
| "encoding/pem" |
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
| // RCL 05 June 2021 | |
| /* | |
| verify with `openssl pkey -in <privatekey>` or `openssl pkey -in <privatekey> -pubout` | |
| the latter should match the publickey | |
| */ | |
| package main | |
| import ( |