Skip to content

Instantly share code, notes, and snippets.

🤠
overhauling globset

Andrew Gallant BurntSushi

🤠
overhauling globset
Block or report user

Report or block BurntSushi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am burntsushi on github.
  • I am burntsushi (https://keybase.io/burntsushi) on keybase.
  • I have a public key ASCuYAG9GLe7P0uomyj2f5-C82uGTD9NwBZGivEXj_7pfQo

To claim this, I am signing this object:

View qcsv.py
"""
A small API to read and analyze CSV files by inferring types for
each column of data.
Currently, only int, float and string types are supported.
from collections import namedtuple
"""
from __future__ import absolute_import, division, print_function
from collections import namedtuple
import csv
View rustdoc-condensed.js
// works as of 2019-03-02
(function() {
// This function forces rustdoc to collapse documentation for all items,
// except for the methods defined in an impl block and the primary type's
// declaration. This is the most natural view IMO, since it provides the
// primary type along with an easy to scan overview of available methods.
//
// rustdoc does seemingly have user settings that purport to make this the
// default, but I could never cause them to work in a reliably consistent
// way. This is especially useful when writing documents, where you commonly
@BurntSushi
BurntSushi / 01-possible-generic-map.go
Last active May 14, 2019
Code from my blog post "Writing type parametric functions in Go."
View 01-possible-generic-map.go
// This is *not* valid Go!
func Map(f func(A) B, xs []A) []B {
ys := make([]B, len(xs))
for i, x := range xs {
ys[i] = f(x)
}
return ys
}
Map(func(x int) int { return x * x }, []int{1, 2, 3})
You can’t perform that action at this time.