Skip to content

Instantly share code, notes, and snippets.

View TheCoreMan's full-sized avatar

Shay Nehmad TheCoreMan

View GitHub Profile
@TheCoreMan
TheCoreMan / main.go
Created April 27, 2024 09:16
A short go script to refresh your Hugo post dates.
// A short script to update the date in the frontmatter of a Hugo post.
// The date is updated to the current date and time.
// Run this script with `go run scripts/refresh-post-date/main.go -file path/to/post.md`,
// and you'll see:
// > ❯ go run main.go -file path/to/post.md
// > 12:10PM INF Refreshed by diff=1m55s
// > 12:10PM INF Successfully updated the date! 🎉 post=path/to/post.md
// You can add the `-verbose` flag to see more detailed logs.
package main
@TheCoreMan
TheCoreMan / flashcard.html
Created April 18, 2023 22:42
Hugo flashcard HTML Shortcode
<!-- Made by Shay Nehmad, feel free to use. For details see
https://mrnice.dev/posts/hugo-flashcard-shortcode-for-study/
-->
<!-- This "with" is for error handling, see
https://gohugo.io/templates/shortcode-templates/#error-handling-in-shortcodes
-->
{{ with .Get "question" }}
<!-- get a random string to add to each ID -->
{{ $seed := now.Format ":time_full" }} {{ $random := delimit (shuffle (split
@TheCoreMan
TheCoreMan / keychain.go
Created March 10, 2019 13:40
Cute Keychains for random internet stranger
# THIS IS IN A PROGRAMMING LANGUAGE CALLED GOLANG
package main
import "fmt"
func main() {
fmt.Println("Bound 2")
}