This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##? We can create a wrapper function for Distrobox that makes our lives much easier. | |
| ##? | |
| ##? For one, it adds an is-inside subcommand for checking whether you're in a container. | |
| ##? It also modifies the enter subcommand to remember the last container we were in, which turns out to be super useful. | |
| ##? Most importantly, though, it changes our create command to add packages layered to our immutable system, and mount the | |
| ##? install location of ublue-brew (e.g. Linuxbrew) | |
| ##? | |
| function box | |
| set -l cmd $argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| // UpdateLogger is a concrete type which can observe | |
| // Observable and log their updates | |
| type UpdateLogger struct { | |
| message string | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import useCanvas from "./useCanvas"; | |
| import { useWindowSize } from "@uidotdev/usehooks"; | |
| const App = () => { | |
| const { width, height } = useWindowSize(); | |
| const canvasRef = useCanvas( | |
| (ctx, frame) => { | |
| ctx.fillRect(100, 100 + frame, 100, 100); | |
| }, |