Skip to content

Instantly share code, notes, and snippets.

View Sacristan's full-sized avatar

Ģirts Ķesteris Sacristan

View GitHub Profile
find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
using UnityEngine;
using UnityEditor;
public class InvertedSphere : EditorWindow
{
private string st = "1.0";
[MenuItem("GameObject/Create Other/Inverted Sphere...")]
public static void ShowWindow()
{
@MattOstgard
MattOstgard / .gitattributes
Last active August 8, 2021 15:06 — forked from heiths/.gitattributes
.gitattributes for Unity3D with git-lfs
# Unity
*.cginc text
*.cs diff=csharp text
*.shader text
# Unity YAML
*.anim merge=unityyamlmerge eol=lf
*.asset merge=unityyamlmerge eol=lf
*.controller merge=unityyamlmerge eol=lf
@zeux
zeux / roblox-graphics-api-2016.md
Last active December 28, 2020 15:22
ROBLOX Graphics APIs - EOY 2016

Windows

API Share
Direct3D 11+ 71%
Direct3D 10.1 14%
Direct3D 10.0 11%
Direct3D 9 4%

D3D9 seems to be dropping by about 0.5% every 2 months - if this keeps going we'll be able to phase it out late next summer.

@DashW
DashW / TriplanarNormal.shader
Created October 19, 2016 14:31
Unity Normal-Mapped Triplanar Texturing Shader
Shader "Tri-Planar World Normal" {
Properties{
_Color("Main Color", Color) = (1,1,1,1)
_Side("Side", 2D) = "gray" {}
_Top("Top", 2D) = "gray" {}
_Bottom("Bottom", 2D) = "gray" {}
_SideScale("Side Scale", Float) = 2
_TopScale("Top Scale", Float) = 2
_BottomScale("Bottom Scale", Float) = 2
_BumpMapSide("Side Normal Map", 2D) = "bump" {}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public static class PivotUtilities
{
[MenuItem("GameObject/Pivot/Create Pivot", false, 0)]
static void CreatePivotObject()
{
@nemotoo
nemotoo / .gitattributes
Last active August 18, 2025 07:49
.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
@maxattack
maxattack / QuaternionUtil.cs
Last active August 22, 2025 12:15
Some Helper Methods for Quaternions in Unity3D
using UnityEngine;
/*
Copyright 2016 Max Kaufmann ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@DashW
DashW / ScreenRecorder.cs
Last active June 22, 2025 23:29
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)