Skip to content

Instantly share code, notes, and snippets.

@brunocalza
brunocalza / main.go
Created September 19, 2024 21:12
Example of Identity-Based Encryption in Go
package main
import (
"fmt"
"log"
"v.io/x/lib/ibe"
)
const ID = "[email protected]"
@brunocalza
brunocalza / upload.go
Created January 3, 2024 21:51
Web3 Storage Go Upload example
package main
import (
"bytes"
_ "embed"
"fmt"
"io/ioutil"
"net/http"
"github.com/ipfs/go-cid"
@brunocalza
brunocalza / mmap-exec.go
Last active January 25, 2021 02:53
This a full example of how PROT_EXEC works in mmap. More about it at https://brunocalza.me/2021/01/10/discovering-and-exploring-mmap-using-go/
package main
import (
"fmt"
"unsafe"
"github.com/edsrzf/mmap-go"
)
func main() {
@brunocalza
brunocalza / create_index_include.sql
Last active June 27, 2020 16:30
Demo on INCLUDE option when creating a index on PostgreSQL
-- Only available on PostgreSQL 11
/* We'll create a table and load a million data and compare a two indexes, onde with included data and the other without it */
/* The table will for demonstration */
CREATE TABLE "user" (
id BIGSERIAL NOT NULL,
name VARCHAR(32) NOT NULL,
email VARCHAR(32) NOT NULL,
aboutme VARCHAR(256),