package main
//go:noinline
func thing(values ...string) {
for _, v := range values {
println(v)
}
}
This file contains 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
--- this shells out to https://llm.datasette.io/en/stable/ | |
vim.api.nvim_create_user_command("LLM", function(opts) | |
local system = [[ | |
You are a neovim expert. | |
You help users write commands. | |
When a user asks a question, your output will be copied directly into the neovim command prompt. | |
Do not add any explanation. | |
Since the output is being copied in the command line, it should all be on a single line. | |
]] | |
local output = vim.system( |
This file contains 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/expect -f | |
# Set timeout to prevent the script from hanging | |
set timeout -1 | |
# Get the search pattern as a command line argument | |
if {[llength $argv] != 0} { | |
set pattern [lindex $argv 0] | |
} else { | |
puts "Error: search pattern not provided" |
This file contains 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" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"path/filepath" |
This file contains 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
-- The TypeScript LSP server takes a while before it's responsive. This is a janky way of indicating the server status in | |
-- airline. It works by adding "..." to the statusline when the LSP connects, and then removing the "..." when the first | |
-- set of diagnostics come in. | |
vim.cmd([[ | |
let g:lsp_wait_added = 0 | |
let g:lsp_wait_done = 0 | |
function! LspWait(...) | |
let builder = a:1 | |
let context = a:2 |
This file contains 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
{ | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"schemes": [ | |
"https" | |
], |
This file contains 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 bufutil | |
import ( | |
"bufio" | |
"bytes" | |
) | |
// SkipTo finds the first instance of delim and discards everything before it. | |
func SkipTo(br *bufio.Reader, delim []byte) (err error) { | |
min := len(delim) |
This file contains 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" | |
"math" | |
"strings" | |
) | |
func main() { | |
g := Game{ |
This file contains 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 binutil | |
// ShiftLeft performs a left bit shift operation on the provided bytes. | |
// If the bits count is negative, a right bit shift is performed. | |
func ShiftLeft(data []byte, bits int) { | |
n := len(data) | |
if bits < 0 { | |
bits = -bits | |
for i := n - 1; i > 0; i-- { | |
data[i] = data[i-1]<<(8-bits) | data[i]>>bits |
This file contains 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 contextutil | |
import ( | |
"context" | |
"time" | |
) | |
// ResetFunc resets the context timeout timer | |
type ResetFunc func() |
NewerOlder