-
Don't write comments based on opinion or gut feeling. Have a reason. If possible, back it up with a reference (style guide, docs, performance data, etc).
-
Write full sentences and don’t leave out context. Be clear so the reader doesn’t have to guess what you mean.
-
Avoid vague "why?" questions. If something is not clear, ask for clarification in a specific way. If something needs changing, suggest the change and explain why.
This file contains hidden or 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
| // This is `file.zig` | |
| // Run: ~/.local/share/zig/0.17.0-dev.56+a8226cd53/zig run file.zig | |
| const std = @import("std"); | |
| pub fn main(init: std.process.Init.Minimal) !void { | |
| // Set up a general-purpose allocator. | |
| var debug_allocator: std.heap.DebugAllocator(.{}) = .init; | |
| defer _ = debug_allocator.deinit(); | |
| const gpa = debug_allocator.allocator(); |
This file contains hidden or 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 | |
| # Installing Bubblewrap on Debian or Ubuntu | |
| # sudo apt install bubblewrap | |
| # sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| CLAUDE=$(which claude 2>/dev/null || echo "$HOME/.local/bin/claude") | |
| NODE=$(which node 2>/dev/null) | |
| if [[ ! -f "$CLAUDE" ]]; then |
This file contains hidden or 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
| default_stages: [ pre-push ] | |
| fail_fast: false | |
| repos: | |
| - repo: https://github.com/pre-commit/pre-commit-hooks | |
| rev: v5.0.0 | |
| hooks: | |
| - id: trailing-whitespace | |
| args: [ --markdown-linebreak-ext=md ] | |
| - id: end-of-file-fixer |
This is a minimal version of Unity-Dependencies-Hunter in less than 100 lines of code. It scans all assets in the project, checks their dependencies, and lists those that are not referenced by any other asset.
Put it in the Assets/Editor directory and run it from Tools -> Unreferenced Assets Finder.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;Using consistent naming conventions in Unity projects helps keep everything organized and easy to work with. Below is a list of recommended conventions for naming components, scripts, variables, methods, folders, and game objects in a Unity project.
- PascalCase for Classes:
- Use PascalCase for class names (e.g.,
PlayerController,GameManager).
This file contains hidden or 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
| # This script creates a basic Unity project structure in the current directory. | |
| # To run the script, open a PowerShell terminal and execute the following command: | |
| # .\CreateUnityProjectStructure.ps1 | |
| param( | |
| [string]$BaseDir = (Get-Location).Path | |
| ) | |
| # Function to create a directory and handle errors | |
| function Create-Dir { |
This file contains hidden or 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
| -- Note that numbers are estimates, so the exact number of rows or index size might slightly differ from the number shown | |
| -- For MySQL or MariaDB | |
| select | |
| table_name as `table name`, | |
| table_rows as `row count`, | |
| round(data_length / (1024 * 1024 * 1024), 2) as `data size (gb)`, | |
| round(index_length / (1024 * 1024 * 1024), 2) as `index size (gb)`, | |
| round((data_length + index_length) / (1024 * 1024 * 1024), 2) as `total size (gb)` | |
| from |
This file contains hidden or 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 | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install libopenal1:i386 libgtk2.0-0:i386 libvkd3d1 gamemode # gamemode:i386 | |
| #sudo apt install gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-bad:i386 gstreamer1.0-plugins-ugly:i386 gstreamer1.0-libav:i386 | |
| # OpenSSL 1.0 |
This file contains hidden or 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
| import argparse | |
| import json | |
| import re | |
| from pathlib import Path | |
| import gspread | |
| import pandas as pd | |
| from getfilelistpy import getfilelist | |
| from google.oauth2 import service_account | |
| from tqdm import tqdm |
NewerOlder