This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Run from PS using: | |
:: powershell -executionpolicy bypass -File .\windows_winget_freshinstall.ps1 | |
:: Install winget (from Windows Store, or..) | |
:: (for instructions for Windows sandbox) | |
$progressPreference = 'silentlyContinue' | |
Write-Information "Downloading WinGet and its dependencies..." | |
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle | |
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx | |
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
using UnityToolbarExtender; | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git lfs migrate import --no-rewrite "broken file.jpg" | |
# OR older, and slower way: | |
git rm --cached -r . | |
git reset --hard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To collapse a whole project into a single file: | |
"cat files in current folder and all subfolders" | |
find . -type f -exec cat {} + | |
cat accepts multiple arguments: | |
cat * */* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Camera controls like Unity Editor. | |
/// </summary> | |
public class SceneLikeCamera : MonoBehaviour | |
{ | |
[Header("Focus Object")] | |
[SerializeField, Tooltip("Enable double-click to focus on objects?")] | |
private bool doFocus = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Assets/Editor/SearchForComponents.cs | |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class SearchForComponents : EditorWindow | |
{ | |
[MenuItem("Tools/Search For Components")] | |
static void Init () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions CI for Unity Hololens 2 UWP running on windows. | |
name: CI | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run directly from bash without download: | |
# curl -s https://gist.githubusercontent.com/danieldownes/c31b2107879555ebcb436a4e10d2826a/raw/ca495f5f28af778c72712472d279e27698c5606f/commitFilesByModificationDate.sh | bash | |
# Get list of all files in all folders and subfolders | |
# ignore file and '.git' folder | |
# Sort by modification date, desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Get total area of each triangle. | |
/// Find a random point within that total area. | |
/// Lookup which triangle that point relates to | |
/// Find a randiom point which point that triangle | |
/// This works for all mesh types, and gives fully distributed results. | |
/// Gist: https://gist.github.com/danieldownes/b1c9bab09cce013cc30a4198bfeda0aa |
NewerOlder