Skip to content

Instantly share code, notes, and snippets.

View gwuah's full-sized avatar
🎯
Focusing

Kwaw gwuah

🎯
Focusing
View GitHub Profile
const {router} = require("ottis");
/* Using our router, we declare permissions for admin role */
const admin = {
/* define permissions on customer resource */
customers: [router("*").all()],
/* define permissions on anonymous-customer resource */
anonymousCustomers: [router("*").all()],
/* define permissions on products resource */
products: [
@gwuah
gwuah / file-downloader.go
Last active February 2, 2021 10:01
file-downloader
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
"time"

Rust Module System

The rust compiler makes little/no assumptions about the structure of your project. You’re required to construct your entire module tree yourself. To make our work easy, it provides us with some building blocks for this construction

The rust module systems works similar to modern filesystems. There’s a parent & some children. That said, rust has a unique way of doing everything you already know, so I’ll advice you approach this note on a blank state and try to draw parallels later.