Skip to content

Instantly share code, notes, and snippets.

@nshelton
nshelton / HierarchyIcons.cs
Created August 21, 2019 06:13
draw icons in the unity hierarchy view (put in your Editor folder)
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.Tilemaps;
using UnityEngine.Timeline;
using UnityEngine.UI;
using UnityEngine.U2D;
using UnityEngine.Rendering;
using UnityEngine.Playables;
using UnityEngine.EventSystems;
@eral
eral / NonDirectionalBooleanMatrix.cs
Last active February 14, 2021 02:57
Property Drawer Like Layer Collision Matrix
// (C) 2018 ERAL
// Distributed under the Boost Software License, Version 1.0.
// (See copy at http://www.boost.org/LICENSE_1_0.txt)
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
@5argon
5argon / GoogleSpreadsheetUnity.cs
Created May 2, 2018 15:13
How to get Google Spreadsheet data to Unity. Put Google Api + Auth + Sheets .dll into your project. Then put .p12 service account file somewhere in Assets.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Sheets.v4;
using Google.Apis.Sheets.v4.Data;
using Google.Apis.Services;
//Attach to player object
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class Voice : NetworkBehaviour
{
int lastSample;
AudioClip c;
@ditzel
ditzel / MathParabola.cs
Last active October 16, 2025 15:26
A simple Math class to calculate a point in 2D or 3D space lying on a parabola. And a more complex parabola controller that you can put on an object.
using UnityEngine;
using System;
public class MathParabola
{
public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t)
{
Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
@douduck08
douduck08 / README.md
Last active May 17, 2025 19:06
The general GetValue extension of SerializedProperty in Unity Editor.

Unity's SerializedProperty not support custom type value setting. This extension use Reflection to get target instance of SerializedProperty in Custom Editor, made value setting of general type is posible.

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active October 24, 2025 19:41
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active October 8, 2025 11:34
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active September 8, 2025 00:49
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 23, 2025 13:28
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {