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 / render_auto_save.py
Created September 26, 2024 19:10
Blender Addon - Auto Saves render (updated for Blender 4.2 and Eevee Next)
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@whoisryosuke
whoisryosuke / markdown-directory-tree.md
Created July 27, 2020 21:03
Markdown / Documentation - Generate Markdown-friendly directory / folder tree structure - @see: https://stackoverflow.com/a/23990108
  1. Install the Linux package tree using Homebrew: brew install tree
  2. Run the tree command on any directory to generate a Markdown friendly structure: tree your-directory

You can save it to a file by piping the results into a text file: tree . >> directory-structure.md

Example

packages/button
├── lib
@whoisryosuke
whoisryosuke / Update-branch.md
Created September 17, 2019 17:38 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@whoisryosuke
whoisryosuke / laravel-uuid-guide.md
Last active September 7, 2024 19:43
Laravel - Enabling UUID for model (v6 tested) -- uses \Illuminate\Support\Str::uuid

Migrations

Add UUID (or swap bigIncrement) and make sure to set as primary column:

        Schema::create('events', function (Blueprint $table) {
            $table->uuid('id')->primary();

When using the column as a foreign key in a pivot table, create a UUID column and do the same foreign key assignment:

@whoisryosuke
whoisryosuke / GpuPrinter.cginc
Created August 12, 2024 18:20 — forked from FreyaHolmer/GpuPrinter.cginc
A unity shader .cginc to draw numbers in the fragment shader - see the first comment below for example usage!
///////////////////////////////////////////////////////////////////////////////
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader
// AUTHOR: Freya Holmér
// LICENSE: Use for whatever, commercial or otherwise!
// Don't hold me liable for issues though
// But pls credit me if it works super well <3
// LIMITATIONS: There's some precision loss beyond 3 decimal places
// CONTRIBUTORS: yes please! if you know a more precise way to get
// decimal digits then pls lemme know!
// GetDecimalSymbolAt() could use some more love/precision
@whoisryosuke
whoisryosuke / check-if-exists.js
Created July 20, 2018 18:55
Javascript - Check if element exists
var checkExist = setInterval(function() {
if ($('.ao-form-field').first()) {
console.log("Exists!");
formFixer()
clearInterval(checkExist);
}
}, 100); // check every 100ms
@whoisryosuke
whoisryosuke / CustomShaderWithUniforms.tsx
Created August 1, 2022 21:18
R3F / ThreeJS / Typescript - Custom shader types that support Uniform
import * as THREE from "three";
import { MeshProps, Object3DNode, useFrame } from "@react-three/fiber";
import { GlassViewMaterial } from "./shaders/GlassViewShader";
import { Mesh } from "three";
import { useRef } from "react";
// We extend Mesh and replace material with ShaderMaterial - which our custom shader is based off
interface GlassViewMesh extends THREE.Mesh {
material: THREE.ShaderMaterial;
}
@whoisryosuke
whoisryosuke / delta-filter-bloom-example.json
Created May 29, 2024 19:51
Delta iOS App Skinning Example - Bloom Filter
{
"name": "Onyx Comic (whoisryosuke)",
"identifier": "com.whoisryosuke.gba.onyxcomic",
"gameTypeIdentifier": "com.rileytestut.delta.game.gba",
"debug": false,
"representations": {
"iphone": {
"edgeToEdge": {
"portrait": {
"assets": {
@whoisryosuke
whoisryosuke / react-instagram-embed.js
Created April 25, 2018 23:31
Instagram component to quickly embed IG posts inside a component
export default class BlogPost extends Component {
constructor(props) {
super(props);
this.state = {
'instagram': false
};
}
@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}`;