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
| #!/usr/bin/env bash | |
| fx ./data/podcasts.json '{...x, podcasts: sortBy(x => x.title)(x.podcasts)}' save |
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
| type UnixTime struct{ time.Time } | |
| func (t *UnixTime) UnmarshalJSON(b []byte) error { | |
| if string(b) == "null" { | |
| t.Time = time.Time{} | |
| return nil | |
| } | |
| var timestamp float64 | |
| if err := json.Unmarshal(b, ×tamp); err != nil { | |
| return err |
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 ( | |
| "bytes" | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "log/slog" | |
| "sync" |
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 fred | |
| import ( | |
| "context" | |
| "database/sql" | |
| "errors" | |
| "log/slog" | |
| "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 "golang.org/x/text/unicode/norm" | |
| type levenshteinDistancer struct { | |
| deletionCost int | |
| insertionCost int | |
| substitutionCost int | |
| } |
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" | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "log/slog" | |
| "os/exec" | |
| "strings" |
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
| { | |
| "description": "Press Escape to switch to English (sends Escape multiple times)", | |
| "manipulators": [ | |
| { | |
| "conditions": [ | |
| { | |
| "input_sources": [{ "language": "^en$" }], | |
| "type": "input_source_unless" | |
| } | |
| ], |
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 ( | |
| "encoding/xml" | |
| "io" | |
| ) | |
| const defaultXmlNs = "http://www.sitemaps.org/schemas/sitemap/0.9" | |
| type Url struct { |
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
| <!-- Copy and paste the following to every html file. --> | |
| <div x-data="{ open: false, title: '', content: '' }" | |
| x-on:htmx:response-error.window="title = $event.detail.xhr.statusText; content = $event.detail.xhr.responseText; open = true"> | |
| <dialog x-bind:open="open"> | |
| <article> | |
| <h2>Error: <span x-text="title"></span></h2> | |
| <p><code x-text="content"></code></p> | |
| <footer> | |
| <button x-on:click="open = false">OK</button> | |
| </footer> |
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" | |
| "strings" | |
| "golang.org/x/text/cases" | |
| "golang.org/x/text/language" | |
| ) |
NewerOlder