Skip to content

Instantly share code, notes, and snippets.

View TarasOsiris's full-sized avatar
🌍
https://ninevastudios.com/

Taras Leskiv TarasOsiris

🌍
https://ninevastudios.com/
View GitHub Profile
@Borod4r
Borod4r / UnityShaders.xml
Last active October 25, 2021 13:26
Basic syntax highlight for Unity ShaderLab code in Project Rider
<!--
Basic syntax highlight for Unity ShaderLab code in Project Rider.
v1.0
Download this file and put it into your "filetypes" folder.
Windows Vista, 7, 8, 10:
<SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.Rider10\config\filetypes
Mac OS X:
@TarasOsiris
TarasOsiris / Driver.cs
Last active April 15, 2016 09:52
Class for frame-by-frame Animation in Editor. Taken from Fabric Unity SDK
namespace Fabric.Internal.Editor.View.Animation
{
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
public class Driver
{
private uint invocationCount = 0;
@t0chas
t0chas / CustomEditorBase.cs
Last active March 5, 2024 16:47
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@TarasOsiris
TarasOsiris / BetterDefines.cs
Last active April 21, 2023 20:22 — forked from Borod4r/BetterDefines.cs
Better Defines for Unity3D
using System;
using System.Collections.Generic;
using System.Linq;
using BetterDefines.Editor.Entity;
using UnityEditor;
namespace BetterDefines.Editor
{
public static class BetterDefinesUtils
{
@Borod4r
Borod4r / FBSucks.cs
Last active March 11, 2022 02:53
Share image with text on android (works with FB)
private static void ShareImageWithTextOnAndroid(string message, string imageFilePath)
{
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + imageFilePath);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), message);
@Borod4r
Borod4r / CustomFolderIcons.cs
Last active April 26, 2016 03:10
CustomFolderIcons.cs
/*
* This script allows you to set custom icons for folders in project browser.
* Recommended icon sizes - small: 16x16 px, large: 64x64 px;
*
* author: Ivan Gadzhega.
* rev: 3
*/
using System.Diagnostics.CodeAnalysis;
using System.IO;
@TarasOsiris
TarasOsiris / FlowMap.shader
Last active April 20, 2023 07:36
Flow Map Shader for Unity3D. Used with Sprites.
Shader "Custom/Flow Map"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
// Flow
_FlowMap ("Flow Map", 2D) = "white" {}
_FlowSpeed ("Flow Speed", float) = 0.05
@lewkoo
lewkoo / add_all_untracked_to_gitignore.sh
Created December 10, 2014 07:50
Add all untracked files to .gitignore
git status -s | grep -e "^\?\?" | cut -c 4- >> .gitignore
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active March 28, 2024 22:25
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 25, 2024 16:50
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)