Skip to content

Instantly share code, notes, and snippets.

View lihaochen910's full-sized avatar
🏠
Working from home

Kanbaru lihaochen910

🏠
Working from home
View GitHub Profile
@phnix-dev
phnix-dev / Signals.cs
Last active October 9, 2022 17:33
Godot signals for c#
// This file is licensed under the Mozilla Public License 2.0.
public static class Signal
{
public static class AcceptDialog
{
public const string CONFIRMED = "confirmed";
public const string CUSTOM_ACTION = "custom_action";
}
@unitycoder
unitycoder / Sprites_ScrollFX-ScreenSpace.shader
Last active February 14, 2024 01:36
Scrolling Sprite Shader Effect
// Unity buit-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// modified to add scrolling lines fx, use black and white mask texture for scrollingtex. - unitycoder.com
Shader "Sprites/ScrollFX (ScreenSpace)"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_ScrollTex("Scroll Texture", 2D) = "white" {}
@jam1garner
jam1garner / switch-gdb-cheatsheet.md
Last active July 6, 2024 13:51
GDB for Switch Modding Cheatsheet/Tutorial

This is a mini-tutorial of sorts for getting started with gdb on the Switch, with the target audience being people who want to mod and/or reverse games, with no prerequisite knowledge of gdb. The goal will be to walk you through some of the basic workflows needed to use a debugger on the Switch, while being brief enough for skimming for when you forget things.

If some part is unclear, your OS doesn't have install instructions, or you feel part of your workflow should be added here, feel free to comment any additions.

(If you only need a quick reference Jump to the Appendix)

Installing GDB

First off you'll need a version of GDB compatible with aarch64. This can be obtained via either a distribution of

@TheSpydog
TheSpydog / fna-wasm-instructions.md
Last active May 23, 2024 16:58
How to build your FNA game for WebAssembly

How to build your FNA game for WebAssembly

WARNING: This process is EXTREMELY experimental and not officially supported yet!

Thanks to the ongoing work on .NET WebAssembly support, it is now possible to build FNA games for the web!

If you decide to give this a try, be sure to tell us about it in the FNA Discord! I'm happy to help if you run into problems or have any further questions that are not answered here.

The Basics

@genotrance
genotrance / flecs.nim
Last active July 6, 2024 06:26
Nim wrapper for flecs using nimterop
# nim c -d:flecsGit -r flecs.nim
import os
import nimterop/[cimport, build]
const
baseDir = getProjectCacheDir("nimflecs")
getHeader(
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 13, 2024 23:25
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@r-malon
r-malon / monokai.md
Created February 27, 2019 19:15
Monokai colors in RGB and HEX format, taken from Sublime Text 3

Monokai Colors in RGB and HEX format


  • Background: (46, 46, 46); #2e2e2e
  • Comments: (121, 121, 121); #797979
  • White: (214, 214, 214); #d6d6d6
  • Yellow: (229, 181, 103); #e5b567
  • Green: (180, 210, 115); #b4d273
  • Orange: (232, 125, 62); #e87d3e
  • Purple: (158, 134, 200); #9e86c8
@xiaobin83
xiaobin83 / Delegate.lua
Created January 8, 2018 10:58
lua delegate stub
return function()
local methods = {}
local meta = {
__add = function(delegates, func)
methods[#methods + 1] = func
return delegates
end,
__sub = function(delegates, func)
for i, f in ipairs(methods) do
if f == func then
@chenxiaolong
chenxiaolong / DellXPS15_9560_AHCI_RAID.md
Created November 27, 2017 01:33
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@oltolm
oltolm / ptrmath.nim
Last active February 25, 2024 19:17
Nim pointer arithmetic
# from https://forum.nim-lang.org/t/1188#7366 by Jehan
# most of the time only the dereference operator is needed, import it like this:
# from ptrmath import `[]`
template `+`*[T](p: ptr T, off: int): ptr T =
cast[ptr type(p[])](cast[ByteAddress](p) +% off * sizeof(p[]))
template `+=`*[T](p: ptr T, off: int) =
p = p + off