Skip to content

Instantly share code, notes, and snippets.

@shelllee
shelllee / DefineSwitcher.cs
Created March 15, 2024 03:17 — forked from nekomimi-daimao/DefineSwitcher.cs
DefineSwitcher - switch #define in unity
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
namespace Nekomimi.Daimao
{
/// <summary>
/// Switch #define.
@shelllee
shelllee / For Mac 4.2.6 unlimited trial.md
Created February 4, 2024 15:23 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@shelllee
shelllee / CustomUnityRender.cs
Created August 31, 2023 03:32 — forked from Slaynash/CustomUnityRender.cs
Custom Unity render loop, drawing a magenta quad at 0,0 of 400x400px (hardcoded offsets for Unity 2018.4.23f1)
private delegate void PerformMainLoop(/* HWND__* */ IntPtr param_1, uint param_2, uint param_3, ulong param_4); // These parameters may be inaccurate
private delegate GfxDevice GetGfxDevice();
private delegate IntPtr GetIVRDevice();
private delegate void SetupPixelCorrectCoordinates(bool _0);
private static IntPtr GetFunctionPointerFromMethod(string methodName) =>
typeof(CustomUnityRender).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Static).MethodHandle.GetFunctionPointer();
internal static void Init()
{
@shelllee
shelllee / PieMenu.cpp
Created February 17, 2023 05:32 — forked from thennequin/PieMenu.cpp
PieMenuAdv
struct PieMenuContext
{
static const int c_iMaxPieMenuStack = 8;
static const int c_iMaxPieItemCount = 12;
static const int c_iRadiusEmpty = 30;
static const int c_iRadiusMin = 30;
static const int c_iMinItemCount = 3;
static const int c_iMinItemCountPerLevel = 3;
struct PieMenu
@shelllee
shelllee / MinRepo.hlsl
Created January 10, 2023 16:02 — forked from iondune/MinRepo.hlsl
Short HLSL shader that causes an internal compiler error
int solve(float x)
{
if (x < 0)
{
return 0;
}
// 1>MinRepo.hlsl(7,2): warning X4000: use of potentially uninitialized variable (solve)
// 1>error X8000 : D3D11 Internal Compiler error : Invalid Bytecode: Negate modifier not allowed for operand #4 of opcode #6 (counts are 1-based).
// ==UserScript==
// @name ucas-course-console-helper
// @namespace https://les1ie.com/
// @version 0.2
// @description 去除中国科学院大学课程网站对进入控制台的限制
// @author Les1ie
// @match https://course.ucas.ac.cn/portal/*
// @grant none
// ==/UserScript==
using UnityEngine;
using UnityEngine.Rendering;
using Unity.Mathematics;
[RequireComponent(typeof(Camera))]
public class Draw : MonoBehaviour
{
[SerializeField] public Mesh Mesh;
[SerializeField] public Material Material;
private Camera mainCamera;
/*============================================================================
NVIDIA FXAA 3.11 by TIMOTHY LOTTES
------------------------------------------------------------------------------
COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
------------------------------------------------------------------------------
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
@shelllee
shelllee / github.css
Created February 2, 2018 11:18 — forked from andyferra/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@shelllee
shelllee / .gitattributes
Created January 3, 2018 08:41 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf