Skip to content

Instantly share code, notes, and snippets.

@liortal53
liortal53 / RemoveEmptyFolders.cs
Last active October 9, 2023 12:46
Clean Unity project from empty folders
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
public class RemoveEmptyFolders
{
/// <summary>
/// Use this flag to simulate a run, before really deleting any folders.
/// </summary>
@helderco
helderco / db-open
Created October 6, 2015 14:51
Script to open a mysql database in Sequel Pro from a service in docker-compose.
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active February 24, 2024 13:40
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@galek
galek / pbr.glsl
Created November 4, 2015 11:10
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
[InitializeOnLoad]
public class EditorCameraSpeed
: EditorWindow
anonymous
anonymous / TimeOfDayManager
Created January 18, 2016 19:11
Control the sun, fog, ambient light, and sun rotation through curves and gradients.
using UnityEngine;
public class TimeOfDayManager : MonoBehaviour
{
public float secondsInFullDay = 120f;
[HideInInspector]
public float timeMultiplier = 1f;
@Skybladev2
Skybladev2 / ExecutionOrderManager.cs
Last active June 29, 2023 11:20
Explicit script exection order for Unity scripts
using System;
using UnityEditor;
[InitializeOnLoad]
public class ExecutionOrderManager : Editor
{
static ExecutionOrderManager()
{
foreach (MonoScript monoScript in MonoImporter.GetAllRuntimeMonoScripts())
{
@nemotoo
nemotoo / .gitattributes
Last active May 18, 2024 08:08
.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
@DreadBoy
DreadBoy / Graph.cs
Created May 15, 2016 08:03
Graph implementation in Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
[Serializable]
public class Graph : ScriptableObject
{
[SerializeField]