Skip to content

Instantly share code, notes, and snippets.

@optinsoft
optinsoft / formatdate.js
Last active December 13, 2025 11:18
Formats a JavaScript Date into a local timestamp string: YYYY-MM-DDTHH:MM:SS.mmm.
/**
* Formats a Date object into a string of the form:
* YYYY-MM-DDTHH:MM:SS.mmm
*
* All numeric components are zero-padded to ensure fixed width.
* The result reflects the local time of the supplied Date object
* and does not include any timezone suffix.
*
* @param {Date} dt - The Date object to format.
* @returns {string} The formatted timestamp string.
@zfarbp
zfarbp / arch.md
Last active January 2, 2026 11:30
Golang - Building Executables for Different Architectures

Golang - Building Executables for Different Architectures

env GOOS=target-OS GOARCH=target-architecture go build package-import-path

# Example
env GOOS=darwin GOARCH=amd64 go build
env GOOS=darwin GOARCH=amd64 go build main.go
env GOOS=darwin GOARCH=amd64 go build github.com/zoo/york/foo/bar