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 this file to your ~/.config/nvim/lua/plugins/. | |
| return { | |
| { | |
| "fatih/vim-go", | |
| }, | |
| } |
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 coworkai | |
| // Example: | |
| // | |
| // n := NewNode() | |
| // n.Add("a") | |
| // n.Add("abcd") | |
| // n.Add("argh") | |
| // n.Add("aria") | |
| // n.Add("abort") |
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 | |
| # See https://pkg.go.dev/cmd/gofmt#hdr-Examples for more info. | |
| gofmt -r 'StructName -> NewStructName' -w ./ |
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 bake | |
| import ( | |
| "errors" | |
| "image" | |
| "image/draw" | |
| ) | |
| // Try radius: 8 and numPasses: 2 with | |
| // https://cdn.pixabay.com/photo/2015/09/21/14/24/zombie-949916_960_720.jpg |
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 bake | |
| import ( | |
| "errors" | |
| "image/color" | |
| "math" | |
| ) | |
| // https://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB | |
| func HSVToRGBA(h float64, s float64, v float64) (*color.RGBA, error) { |
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
| import 'dart:convert'; | |
| final fnv1A64Init = BigInt.parse("0xcbf29ce484222325"); | |
| final fnv1A64Prime = BigInt.from(0x100000001b3); | |
| final uint64Mask = BigInt.parse("0xffffffffffffffff"); | |
| // FNV-1a 64-bit hash function (JavaScript compatible) | |
| // This function is for you if you have seen errors like "Error: The integer literal 0xcbf29ce484222325 can't be represented exactly in JavaScript." | |
| String fnv1A64(String string) { | |
| var hash = fnv1A64Init; |
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
| class EditCaptionView extends StatefulWidget { | |
| final String postId; | |
| const EditCaptionView({super.key, required this.postId}); | |
| @override | |
| State<EditCaptionView> createState() => _EditCaptionViewState(); | |
| } | |
| class _EditCaptionViewState extends State<EditCaptionView> { | |
| final _controller = TextEditingController(); |
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
| // $ gcloud run deploy --source . | |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "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
| #!/usr/bin/env bash | |
| BASE64=$(base64 -i yann-lecun_resize.jpg) | |
| curl --request POST \ | |
| --url http://localhost:8080/v1/images \ | |
| --header 'Content-Type: application/json' \ | |
| --data '{ "image": "'${BASE64}'" }' |
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
| <div x-data="{ inProgress: false }"> | |
| <form x-on:submit="inProgress = true" ...> | |
| ... | |
| <button type="submit" x-bind:aria-busy="inProgress" x-text="inProgress ? 'Please wait...' : 'Generate'"></button> | |
| </form> | |
| </div> |