Skip to content

Instantly share code, notes, and snippets.

@hofmannsven
hofmannsven / README.md
Last active November 22, 2025 10:31
Git CLI Cheatsheet
@karablin
karablin / defer.rs
Last active January 2, 2021 02:10
go-like defer for rust
#[feature(macro_rules)];
struct ScopeCall<'cls> {
c: 'cls ||
}
#[unsafe_destructor]
impl<'cls> Drop for ScopeCall<'cls> {
fn drop(&mut self) {
(self.c)();
}
@simonw
simonw / how-to.md
Last active October 20, 2025 13:16
How to create a tarball of a git repository using "git archive"
@gobwas
gobwas / iface_test.go
Last active December 24, 2024 08:23
Alloc-free interface usage
// This example shows how interfaces could be used without
// pushing inner data to heap.
//
// Note that it was checked with Go 1.8.3 and may become unuseful
// in the future releases of Go.
package main
import (
"encoding/binary"
"testing"