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
@bgolus
bgolus / MatCapTechniques.shader
Created January 29, 2022 00:37
Showing multiple matcap techniques, including a proposed improved method that's no more expensive than the usual fix if you're starting with the world position and world normal.
Shader "Unlit/MatCap Techniques"
{
Properties
{
[NoScaleOffset] _MatCap ("MatCap", 2D) = "white" {}
[KeywordEnum(ViewSpaceNormal, ViewDirectionCross, ViewDirectionAligned)] _MatCapType ("Matcap UV Type", Float) = 2
}
SubShader
{
Tags { "RenderType"="Opaque" }
@tannerlinsley
tannerlinsley / Table.tsx
Last active November 15, 2023 19:53
A quick snippet of an early ReactTable v8 table that renders!
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import { createTable } from 'react-table'
type Row = {
firstName: string
lastName: string
@Enichan
Enichan / triangle.p8
Last active October 6, 2021 07:42
Subpixel accurate triangle rasterizer prototype for Pico 8
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
--[[function spline(x0,y0,x1,y1,c)
local dx = x1 - x0
local dy = y1 - y0
local step = dx/dy
local x = x0 - (y0 % 1) * step
local y = flr(y0)
@benui-dev
benui-dev / PackagePlugin.bat
Last active March 29, 2024 04:30
Unreal Engine Package Plugin batch script. Confirm that your plugin packages under each Unreal Engine version.
@echo off
SETLOCAL
rem Set your plugin name, should match the .uplugin filename
set PLUGIN_NAME=BYGYouTrackFiller
rem Always add trailing space please
rem Don't put trailing slashes
set UNREAL_PATHS=E:\UE_4.25 ^
E:\UE_4.26 ^
@csswizardry
csswizardry / nesting.css
Created February 25, 2021 16:49
DOM Depth Visualiser
/**
* Tier 1 – Dotted
*/
* { outline: 2px dotted purple; }
* * { outline: 2px dotted blue; }
* * * { outline: 2px dotted green; }
* * * * { outline: 2px dotted yellow; }
* * * * * { outline: 2px dotted orange; }
* * * * * * { outline: 2px dotted red; }
@devappd
devappd / build.sh
Last active November 2, 2023 18:28
Minimal OpenGL Emscripten example
mkdir -p bin
emcc -o bin/main.html main.cpp -s USE_SDL=2 -s FULL_ES2=1 -s SINGLE_FILE=1
emcc -o bin/main-asyncify.html main.cpp -s USE_SDL=2 -s FULL_ES2=1 -s ASYNCIFY=1 -s SINGLE_FILE=1
@geordiemhall
geordiemhall / MyCheatManager.cpp
Last active March 15, 2024 10:27
UE4 Cheat manager with meta-based cheat names
#include "MyCheatManager.h"
#include "Engine/Console.h"
#include "AssetRegistryModule.h"
DEFINE_LOG_CATEGORY(LogCheatManager);
void UMyCheatManager::AddWorkers(int32 NumWorkers)
{
UE_LOG(LogCheatManager, Log, TEXT("%s: AddWorkers: %i"), *GetName(), NumWorkers);
}
@AlexVanderbist
AlexVanderbist / opendb.sh
Created September 17, 2020 16:21
`opendb` command - opens the database for a Laravel app in your GUI
opendb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@gatsbyjs-employees
gatsbyjs-employees / Open letter to the Gatsby community.md
Last active February 23, 2021 00:24
Open letter to the Gatsby community

To the Gatsby Community,

We want to start by specifically thanking Nat Alison. We support her and commend her bravery in speaking out. It is not easy to stand alone. What she experienced at Gatsby was unacceptable and speaks to wider issues. We thank her for putting pressure on the company to fix them. We vow to double down on those efforts.

While we have worked hard to give feedback and help create a healthy work environment over the past few years, change has been far too slow and the consequences have been real. The previous weeks have intensified the need for rapid change by increasing employee communication and allowing us to collectively connect some dots. We are just as outraged. As a result, we have posed a series of hard questions to management as well as a list of concrete actions they need to take.

Kyle Mathews' public apologies to both Nat Alison and Kim Crayton are small actions swiftly taken that signal the possibility for change but don't speak to the systemic issues that must be addressed.

@cassidoo
cassidoo / useMedia.jsx
Last active October 27, 2022 16:13
An example of checking on a media query with React Hooks
function useMedia(query) {
const [matches, setMatches] = useState(window.matchMedia(query).matches)
useEffect(() => {
const media = window.matchMedia(query)
if (media.matches !== matches) {
setMatches(media.matches)
}
const listener = () => {
setMatches(media.matches)