Revision: 0.0.1
GDD Template Written by: Benjamin “HeadClot” Stanley
- Overview
- Theme / Setting / Genre
- Core Gameplay Mechanics Brief
- Targeted platforms
Revision: 0.0.1
GDD Template Written by: Benjamin “HeadClot” Stanley
#!/bin/sh | |
ticket=$(git symbolic-ref HEAD | grep -e '[A-Z]\+-[0-9]\+_[0-9]\+' -o) | |
if [ -n "$ticket" ]; then | |
echo "$ticket - $(cat $1)" > $1 | |
fi |
<?php | |
use Magento\Customer\Model\Session as CustomerSession; | |
use Magento\Framework\App\Action\Action; | |
use Magento\Framework\App\Action\Context; | |
use Magento\Framework\App\RequestInterface; | |
use Magento\Framework\Controller\ResultFactory; | |
class Index extends Action | |
{ |
using System; | |
using System.Collections.Generic; | |
using Sirenix.OdinInspector; | |
using UnityEngine; | |
[ExecuteInEditMode] | |
public class HandManager : MonoBehaviour | |
{ | |
/// <summary> | |
/// The area of a card that should be used to determine whether to select the previous, current, or next card |
import fs from 'fs'; | |
import path from 'path'; | |
import Sequelize from 'sequelize'; | |
import sqlite from 'sqlite3'; | |
import { | |
app, | |
remote | |
} from 'electron'; | |
const basename = path.basename(__filename); |
function deepMapGet(map, keys) { | |
return keys.reduce( | |
(resultValue, key) => | |
resultValue === undefined ? resultValue : resultValue.get(key), | |
map, | |
); | |
} |
[1, 2, 3, 4, 5] | |
.reduce( | |
sequentialPromise(element => new Promise(resolve => | |
setTimeout( | |
() => { | |
console.log(`Handled ${element}`); | |
resolve(element * Math.floor(Math.random() * 100)); | |
}, | |
Math.random() * 1000 | |
) |
Sometimes we don't want to prop drill or have many components where we don't know where they will exist in the component tree,
but have frequent enough updates where a simple Context will cause unncessary re-renders or performance issues.
By utilizing useSyncExternalStore
with a simple store, we can avoid this and have only the
components who care about the updates get re-rendered.
This may be similar to something like Redux or Zuestand, but for simple things, those are overkill to import an entire package for. The example I provided above can be a nice quick way of handling these occasional use cases without diving full send into a state management library.
import { | |
type PropsWithChildren, | |
type ReactNode, | |
createContext, | |
forwardRef, | |
useContext, | |
useImperativeHandle, | |
useRef, | |
} from 'react' | |
import { type StoreApi, createStore, useStore } from 'zustand' |