Skip to content

Instantly share code, notes, and snippets.

View ww9's full-sized avatar
When everything hangs on a single moment, be sure you choose the right moment.

ww9

When everything hangs on a single moment, be sure you choose the right moment.
View GitHub Profile
@ww9
ww9 / go_type_assertion_is_fast.md
Created November 17, 2018 22:36
Benchmark showing that type assertion in Go is pretty fast
@ww9
ww9 / chromium_based_edge.md
Created December 7, 2018 13:30
Chromium based Microsoft Edge announcement

source: https://blogs.windows.com/windowsexperience/2018/12/06/microsoft-edge-making-the-web-better-through-more-open-source-collaboration/

DECEMBER 6, 2018 9:00 AM

Microsoft Edge: Making the web better through more open source collaboration

By Joe Belfiore / Corporate Vice President, Windows

For the past few years, Microsoft has meaningfully increased participation in the open source software (OSS) community, becoming one of the world’s largest supporters of OSS projects. Today we’re announcing that we intend to adopt the Chromium open source project in the development of Microsoft Edge on the desktop to create better web compatibility for our customers and less fragmentation of the web for all web developers.

@ww9
ww9 / gui_apps_using_go_html_js_css.md
Last active September 1, 2020 19:32
Simple GUI example using https://github.com/zserge/lorca. Shows Go<->Js communication. #go

GUI programs using Go and HTML/CSS/JS

Superior to similar solutions. Doesn't use electron or cgo. Easy communication between Go and Js. Can easily use libs like React, Vue and Angular.

This is a demo app using GUI library https://github.com/zserge/lorca which requires only Chrome and might even work with Firefox in the future.

@ww9
ww9 / _vanilla_go_web_server.md
Last active November 22, 2020 00:43 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies

Go vanilla web server

Go web server with logging, tracing, health check, graceful shutdown and zero dependencies.

@ww9
ww9 / .NET6Migration.md
Created September 19, 2021 01:54 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration
@ww9
ww9 / A_README.md
Created August 21, 2020 01:52 — forked from gmamaladze/A_README.md
HashSet that preserves insertion order or .NET implementation of LinkedHashSet

HashSet that preserves insertion order or .NET implementation of LinkedHashSet

Many people naively assume an ordinary .NET HashSet preserves insertion order. Indeed HashSet accidentally preserves insertion order until you remove and re-add some elements. There is such a data structure in Java - LinkedHashSet which respects order and has O(1) RW times.

No, I did not find a (working) corresponding implementation in .NET. That's I wrote this one.

The implementation uses linked list in combination with dictionary to define the iteration, ordering and at the same time allow O(1) removal.

The order is not affected if an element is re-inserted into the set it retains it's old position.

@ww9
ww9 / README.rst
Created August 17, 2023 09:11 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@ww9
ww9 / gist_blog.md
Last active January 12, 2024 23:00
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
@ww9
ww9 / public_domain_software.md
Last active February 6, 2024 03:42
Public Domain Software #blog

TLDR

Public Domain is not a license and isn't legally accepted in some countries. So if you want to give stuff for free, it's better to just license it under MIT or BSD.

Public Domain Software

The term “public domain” refers to creative materials that are not protected by intellectual property laws such as copyright, trademark, or patent laws. The public owns these works, not an individual author or artist. Anyone can use a public domain work without obtaining permission, but no one can ever own it. - Stanford University definition

Can Cannot
@ww9
ww9 / context_keys_as_struct_not_int_or_string.md
Last active April 10, 2024 14:14
Why use empty struct{} and not int or string for context.Value() key types in #go

Use struct{} as keys for context.Value() in Go

In the other file of this gist I detail why we should use struct{} as context.Value() keys and not int or string. Open gist to see main.go but the TLDR is:

	type key struct{}
	ctx = context.WithValue(ctx, key{}, "my value") // Set value
	myValue, ok := ctx.Value(key{}).(string) // Get value