Skip to content

Instantly share code, notes, and snippets.

View whoisryosuke's full-sized avatar
👾
Going deep with game development

Ryosuke whoisryosuke

👾
Going deep with game development
View GitHub Profile
@whoisryosuke
whoisryosuke / music-notes.ts
Created January 27, 2024 01:34
Typescript - Music Notation types using new template literal feature
export type BaseNote = "C" | "D" | "E" | "F" | "G" | "A" | "B";
export type Octaves = "1" | "2" | "3" | "4" | "5" | "6" | "7";
export type Note = `${BaseNote}${Octaves}`;
@whoisryosuke
whoisryosuke / render-all-frames-and-sleep.js
Created November 9, 2023 09:43
Blender Flamenco - Render Frames and Sleep - Select a series of frames, sleep duration, and batch size -- and it'll render all frames then in batches while sleeping between. Good for chunking renders and letting PC rest between segments in a single job (instead of queuing chunks manually)
// SPDX-License-Identifier: GPL-3.0-or-later
const JOB_TYPE = {
label: "Render All and Sleep",
settings: [
// Settings for artists to determine:
{
key: "frames",
type: "string",
required: true,
@whoisryosuke
whoisryosuke / render-frames-and-sleep.js
Created November 7, 2023 20:10
Blender Flamenco - Render Frames and Sleep - Select a series of frames and a sleep duration and it'll render all frames then sleep after. Good for chunking renders and letting PC rest between segments.
// SPDX-License-Identifier: GPL-3.0-or-later
const JOB_TYPE = {
label: "Render and Sleep",
settings: [
// Settings for artists to determine:
{
key: "frames",
type: "string",
required: true,
@whoisryosuke
whoisryosuke / transparent-egui-window.rs
Created April 24, 2023 19:48
egui / Bevy - Transparent Window styling
fn ui_example_system(mut contexts: EguiContexts) {
// Set window styles
let ctx = contexts.ctx_mut();
let old = ctx.style().visuals.clone();
ctx.set_visuals(egui::Visuals {
window_fill: Color32::TRANSPARENT,
panel_fill: Color32::TRANSPARENT,
window_stroke: egui::Stroke {
color: Color32::TRANSPARENT,
width: 0.0,
@whoisryosuke
whoisryosuke / GPUOptimizationForGameDev.md
Created December 19, 2022 07:32 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for GameDev
@whoisryosuke
whoisryosuke / body.css
Created November 12, 2022 09:04
Mastodon Theme - Dark Chakra UI - Based on Mastodon FlatCSS (https://github.com/trwnh/mastomods). Install using Stylus Chrome Extension
/*
* OK, now back to business... the rest of this code applies only to the instance.
*/
/*------------------------------------------------------------------------------
* MISC TWEAKS
*
* Miscellaneous tweaks that are more like extensions of the theme,
* rather than subsets or features. These could ostensibly be their
* own user-styles, and are only bundled in here for convenience.
* Or, they are not supported in all browsers. They may be removed
@whoisryosuke
whoisryosuke / tasks.json
Created October 18, 2022 06:08
C++ / CMake / VSCode - Tasks for building and testing (using ModernCppStarter). Swap out `GreeterTests` with your test file's name.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "CMake: build",
"command": "cmake --build build/standalone",
"group": "build",
"problemMatcher": [],
"detail": "CMake build task"
@whoisryosuke
whoisryosuke / cmake.bash
Last active October 17, 2022 08:07
C++ / CMake / Windows - Setup a new project for Visual Studio with a CMake file (see example here: https://github.com/SaschaWillems/Vulkan/blob/master/CMakeLists.txt or https://github.com/TheLartians/MiniCppStarter/blob/master/CMakeLists.txt)
# VS 2019
cmake -G "Visual Studio 16 2019" -A x64
# VS 2022
cmake -G "Visual Studio 17 2022" -A x64
@whoisryosuke
whoisryosuke / export.js
Created September 27, 2022 05:52
NodeJS - Parse MD/MDX files and copy images to another folder (blog migration script) - run using `node export.js`
const fs = require('fs')
const path = require('path')
// Loop through all years
// Go into each folder
// Get MDX file
// Add template to frontmatter
// layout: "@/layouts/BlogLayout.astro"
@whoisryosuke
whoisryosuke / tasks.json
Last active August 19, 2022 07:18
Rust / VSCode - Tasks for Cargo Build and Check. CTRL + SHIFT + P, type Run Task, then select cargo run from list. This file goes in .vscode/tasks.json. @see: https://stackoverflow.com/questions/46885292/how-to-launch-a-rust-application-from-visual-studio-code
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "cargo check",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [