package main
//go:noinline
func thing(values ...string) {
for _, v := range values {
println(v)
}
}
View lsptest.go
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" |
View nvim_lsp_status_airline.lua
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 |
View merged.json
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" | |
], |
View skipto.go
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) |
View tic_tac_toe.go
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{ |
View go_variadic_param.md
View shift.go
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 |
View context_util.go
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() |
View versions.go
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 ( | |
"errors" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" |
View rolling_plot_xy.go
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 rolling | |
import "gonum.org/v1/plot/plotter" | |
type XYs struct { | |
size int | |
start int | |
length int | |
data plotter.XYs | |
} |
NewerOlder