Skip to content

Instantly share code, notes, and snippets.

@0riginaln0
0riginaln0 / input.zig
Created March 14, 2025 09:04
Input handling "library" in Zig for WASM-4
const w4 = @import("wasm4.zig");
pub const Input = struct {
previous_frame_gamepad: u8,
current_frame_gamepad: u8,
previous_frame_mouse: u8,
current_frame_mouse: u8,
previous_frame_mouse_x: i16,
@cheikhsimsol
cheikhsimsol / video_stream.go
Created December 30, 2024 19:37
Full video stream example
package main
import (
"fmt"
"io"
"log"
"net/http"
"strconv"
"strings"
)
// Odin + Box2D + Raylib example with stacking boxes and a shape attached to the cursor that can smack the shapes.
// Made (mostly) during this stream: https://www.youtube.com/watch?v=LYW7jdwEnaI
// I have updated this to use the `vendor:box2d` bindings instead of the ones I used on the stream.
package game
import b2 "vendor:box2d"
import rl "vendor:raylib"
@rauchg
rauchg / p.sh
Last active April 15, 2025 22:40
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@alexedwards
alexedwards / Makefile
Last active April 14, 2025 04:22
Boilerplate Makefile for Go projects
# Change these variables as necessary.
main_package_path = ./cmd/example
binary_name = example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
# juggling_balls_game.py
import turtle
import time
import random
from juggling_balls import Ball
# Game parameters
WIDTH = 600
# juggling_balls.py
import random
import turtle
class Ball(turtle.Turtle):
MAX_VELOCITY = 5
GRAVITY = 0.07
BAT_VELOCITY_CHANGE = 8
@BjoernSchilberg
BjoernSchilberg / tetris.py
Created December 8, 2022 18:49 — forked from timurbakibayev/tetris.py
Tetris game in Python
import pygame
import random
colors = [
(0, 0, 0),
(120, 37, 179),
(100, 179, 179),
(80, 34, 22),
(80, 134, 22),
(180, 34, 22),
@sago35
sago35 / launch.json
Last active September 14, 2024 11:05
TinyGo + VSCode + Cortex-Debug for Wio Terminal (ATSAMD51P19A)
{
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"servertype": "openocd",
"request": "launch",
"name": "tinygo-debug",
"runToEntryPoint": "main.main",
"executable": "${workspaceRoot}/out.elf",
@samwightt
samwightt / go.mod
Last active February 16, 2022 07:20
Ebiten example with perlin noise generation
module samw.dev/ebiten
go 1.15
require (
github.com/aquilax/go-perlin v1.1.0
github.com/hajimehoshi/ebiten/v2 v2.2.4
)