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 / 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 / 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 / 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}`;
@whoisryosuke
whoisryosuke / GPUOptimizationForGameDev.md
Created December 19, 2022 07:32 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for GameDev
@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 / vs-code-extensions.bash
Last active October 26, 2023 19:44
VSCode - My extensions (listed as CLI install commands) - exported using `code --list-extensions | xargs -L 1 echo code --install-extension`. To install the code alias on Mac, go to Command Palette and type "install command" to find the shell script
code --install-extension dbaeumer.vscode-eslint
code --install-extension dsznajder.es7-react-js-snippets
code --install-extension Equinusocio.vsc-community-material-theme
code --install-extension Equinusocio.vsc-material-theme
code --install-extension equinusocio.vsc-material-theme-icons
code --install-extension mikestead.dotenv
code --install-extension pnp.polacode
code --install-extension sdras.night-owl
code --install-extension unifiedjs.vscode-mdx
code --install-extension PS C:\Users\Ryo> code --list-extensions
@whoisryosuke
whoisryosuke / react-onclick-proper-target.jsx
Last active October 13, 2023 10:47
React/JS - How to target "parent" instead of child during onClick (problem: e.target refs actual child clicked, instead of onClick wrapper)
const submitForm = (e) => {
// ❌ Targets child
console.log(e.target.value)
// ✅ Targets wrapper with onClick prop
console.log(e.currentTarget.value)
// ✅ If above fails, log currentTarget and see if it looks like HTML
// currentTarget usually returns as type of HTMLElement
@whoisryosuke
whoisryosuke / useGeolocation.md
Last active October 9, 2023 19:36
React Hooks - Geolocation use native browser API

useGeolocation

React sensor hook that tracks user's geographic location.

Hook

const useGeolocation = () => {
  const [state, setState] = useState({
    accuracy: null,