Skip to content

Instantly share code, notes, and snippets.

View Sacristan's full-sized avatar

Ģirts Ķesteris Sacristan

View GitHub Profile
@Sacristan
Sacristan / mysql.database.yml
Created July 4, 2016 18:52 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
sudo apt-get install build-essential gconf-service lib32gcc1 lib32stdc++6 libasound2 libc6 libc6-i386 libcairo2 libcap2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libfreetype6 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libgl1 libglib2.0-0 libglu1 libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 libstdc++6 libx11-6 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 zlib1g
http://forum.unity3d.com/threads/unity-on-linux-release-notes-and-known-issues.350256/
@Sacristan
Sacristan / ui_tricks.md
Last active July 10, 2018 17:32
Unity Tricks
@Sacristan
Sacristan / UnlitTransparentColorGradient.shader
Created October 17, 2016 12:37
Screen space coord Unlit/Transparent Color Gradient shader
Shader "Unlit/Transparent Color Gradient" {
Properties{
_MainTex("Base (RGB) Trans (A)", 2D) = "white" { }
_Color("Color1", Color) = (1.000000,1.000000,1.000000,1.000000)
_Color2("Color2", Color) = (1.000000,1.000000,1.000000,1.000000)
}
SubShader{
LOD 100
Tags{ "QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" }
using UnityEngine;
using System.Collections;

public class ScalePulse : MonoBehaviour
{
    [System.Serializable]
    private struct Scale
    {
 [SerializeField]
@Sacristan
Sacristan / c_sharp_interactive_for_unity.md
Last active March 15, 2017 08:41
VS 2015 C# Interactive use UnityEngine Assembly

#How to open: View-> Other Windows -> C# Interactive

> #r "C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll"
> using UnityEngine;
> Mathf.Sign(-1)
-1
> Vector3 startPos = Vector3.zero;
> Vector3 endPos = Vector3.one;
This is roughly what DrawDefaultInspector() does:
override def OnInspectorGUI():
serializedObject.Update()
EditorGUIUtility.LookLikeInspector()
myIterator = serializedObject.FindProperty("myArrayField")
while true:
myRect = GUILayoutUtility.GetRect(0f, 16f);
showChildren = EditorGUI.PropertyField(myRect, myIterator)
break unless myIterator.NextVisible(showChildren)
@Sacristan
Sacristan / EditorCoroutine.cs
Last active April 13, 2017 03:20 — forked from benblo/EditorCoroutine.cs
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
//Original Author (gracefully borrowed): https://gist.github.com/benblo/10732554
//#define DEBUG_EDITORCOROUTINE
using System.Collections;
using UnityEditor;
namespace Sacristan.EditorExtensions
{
public class EditorCoroutine
{
@Sacristan
Sacristan / example.md
Last active April 2, 2017 11:04
Unity Coroutines
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    private enum States
    {
        Unknown,
find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'