Skip to content

Instantly share code, notes, and snippets.

View Deleplace's full-sized avatar

Valentin Deleplace Deleplace

View GitHub Profile
@Deleplace
Deleplace / main.dart
Last active June 24, 2023 08:52
Clear map
void main() {
var m = {
"one": 1,
"two": 2
};
var p = m;
print(m);
print(p);
@Deleplace
Deleplace / signdance.go
Last active June 20, 2023 15:29
A web server that generates dancing gopher GIFs
# Copyright 2019 Google LLC
# SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/gif"
@Deleplace
Deleplace / mapfunc_test.go
Created November 17, 2022 13:01
Is there a performance penalty when taking a func argument instead of a value argument, in concurrent maps operations?
package mapfunc
import (
"sync"
"testing"
"github.com/puzpuzpuz/xsync/v2"
)
const (
@Deleplace
Deleplace / sortstrings_test.go
Created February 17, 2022 16:52
Benchmark for sorting a slice of strings, case-insensitively
package bench
import (
"math/rand"
"sort"
"strings"
"testing"
"unicode"
"unicode/utf8"
)
@Deleplace
Deleplace / gist:869094a77a5292b40511704482e3e7d8
Created November 9, 2022 10:07
URL for Google Images search, to be used in Chrome in Settings > Search engine > Add
https://www.google.com/search?q=%s&tbm=isch
@Deleplace
Deleplace / stablesort_test.go
Last active November 7, 2022 16:32
Overhead of stable sorting, in Go
package stablesort
import (
"math/rand"
"sort"
"testing"
"golang.org/x/exp/slices"
)
@Deleplace
Deleplace / stablesort_test.go
Created November 7, 2022 15:30
How much overhead for a STABLE sort of 1000 lowercase letters (26 possible values per letter), compared to a standard sort?
package stablesort
import (
"math/rand"
"sort"
"testing"
)
const (
M = 500
@Deleplace
Deleplace / roses-are-red.txt
Created September 15, 2022 09:50
Roses Are Red
Roses are red
Violets are blue,
Sugar is sweet
And so are you.