Skip to content

Instantly share code, notes, and snippets.

View astrolemonade's full-sized avatar
🔍
Happiness should be a pure function without any parameters.

astrolemonade astrolemonade

🔍
Happiness should be a pure function without any parameters.
View GitHub Profile
// HTTP Hello World Server + non-blocking I/O test.
//
// This requires gotip (https://pkg.go.dev/golang.org/dl/gotip) for:
//
// - https://github.com/golang/go/commit/41893389
// - https://github.com/golang/go/commit/c5c21845
// - https://github.com/golang/go/commit/a17de43e
//
// We can use the wasirun command to run the WebAssembly module:
//
import {Layout, LayoutProps} from "@motion-canvas/2d/lib/components"
import {Rect, Vector2} from "@motion-canvas/core/lib/types";
import {property} from "@motion-canvas/2d/lib/decorators"
import {all, sequence} from "@motion-canvas/core/lib/flow";
import {Signal, SignalValue} from "@motion-canvas/core/lib/utils";
import {drawRect} from "@motion-canvas/2d/lib/utils";
import {easeOutCubic, linear} from "@motion-canvas/core/lib/tweening";
import {decorate, threadable} from "@motion-canvas/core/lib/decorators"
import {Layout, LayoutProps} from "@motion-canvas/2d/lib/components"
import {Rect, Vector2} from "@motion-canvas/core/lib/types";
import {initial, property} from "@motion-canvas/2d/lib/decorators"
import {all, delay, sequence, waitFor} from "@motion-canvas/core/lib/flow";
import {Signal} from "@motion-canvas/core/lib/utils";
import {drawRoundRect} from "@motion-canvas/2d/lib/utils";
import {linear} from "@motion-canvas/core/lib/tweening";
import {decorate, threadable} from "@motion-canvas/core/lib/decorators"
import {ThreadGenerator} from "@motion-canvas/core/lib/threading";
use core::ptr::NonNull;
use core::alloc::Layout;
pub trait Alloc {
/// allocates a block of memory.
///
/// - if the call succeeds:
/// - the returned pointer refers to a live allocation.
/// - `layout` is the active layout of the returned memory block.
const SPEEEEEED: bool = 1==1;
pub mod reg {
#[derive(Clone, Copy, Debug)]
#[repr(align(4))]
pub enum Instruction {
LoadInt { dst: u8, value: i16 },
@astrolemonade
astrolemonade / hello-world.rs
Created April 26, 2023 20:28 — forked from badboy/hello-world.rs
Poor dev's Rust Compiler
fn main() {
println!("Hello World!");
}
@astrolemonade
astrolemonade / build-openconnect.sh
Created April 25, 2023 10:14 — forked from yuezk/build-openconnect.sh
Build Openconnect from Source Code on Ubuntu 18.04
# Install dependencies
sudo apt install \
build-essential gettext autoconf automake libproxy-dev \
libxml2-dev libtool vpnc-scripts pkg-config zlib1g-dev \
libp11-kit-dev libp11-dev libssl-dev
# Build
cd openconnect
./autogen.sh
./configure
@astrolemonade
astrolemonade / gospinningcube.go
Created April 17, 2023 23:43 — forked from rkibria/gospinningcube.go
Generate a .gif showing a spinning 3d wireframe cube with hidden lines in Golang
package main
import (
"fmt"
"image"
"image/color"
"image/gif"
"math"
"os"
)
@astrolemonade
astrolemonade / docker-api-port.md
Created April 3, 2023 00:14 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}