Skip to content

Instantly share code, notes, and snippets.

View danfarino's full-sized avatar

Dan Farino danfarino

View GitHub Profile
package main
import (
"bufio"
"fmt"
"strconv"
"strings"
)
func slicesMap[T, U any](ts []T, f func(T) U) []U {
@danfarino
danfarino / semantics.go
Last active September 25, 2020 19:52
Golang interface vs. pointer semantics in interfaces
package main
import "fmt"
type Thinger interface {
DoStuff()
DoThings()
}
type thing1 struct {}
#!/bin/bash
set -Eeuo pipefail
cat > with.go <<EOF
package main
import (
"fmt"
"strings"
# This file is a hack that enables .eslintrc in a create-react-app in dev mode on Windows 10.
# Written and tested against react-scripts@2.0.5
#
# Make sure you replace the default "start" script in package.json with:
# "start": "PowerShell.exe \"%CD%\\enable-eslintrc.ps1\" && react-scripts start",
$file = "node_modules\react-scripts\config\webpack.config.dev.js"
(Get-Content $file) -replace "useEslintrc: false", "useEslintrc: true" | Set-Content $file
@danfarino
danfarino / .block
Last active September 6, 2017 03:59 — forked from mbostock/.block
Animated Quadtree
license: gpl-3.0
height: 960