Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Igor mopsicus

🎯
Focusing
View GitHub Profile
@mopsicus
mopsicus / turbo_aegea.php
Created Jan 14, 2020
Generate RSS channel file Yandex turbo for Aegea blogengine
View turbo_aegea.php
<?
$db_user = ''; // db user name
$db_password = ''; // db pass
$db_database = ''; // db name
$db_host = 'localhost'; // db url
$domain = 'mopsicus.ru'; // domain
$title = '#mopsicus.ru – про Unity, игры и разработку'; // title for channel
$desc = 'Блог о Unity, разработке и личном опыте'; // desciption
@mopsicus
mopsicus / SnapPosition.cs
Created Jan 16, 2020
Snap position for screen edges with offset
View SnapPosition.cs
using UnityEngine;
/// <summary>
/// Fix position for objects in non canvas
/// </summary>
[ExecuteInEditMode]
public class SnapPosition : MonoBehaviour {
/// <summary>
/// Anchor settings
@mopsicus
mopsicus / DefaultStencil.shader
Last active Jan 28, 2020
DefaultStencil.shader (old shader for old Unity version)
View DefaultStencil.shader
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Sprites/DefaultStencil"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
@mopsicus
mopsicus / installtools.sh
Created Feb 26, 2020
Bash script for uninstalling and installing apk on multiple connected devices at once
View installtools.sh
#!/bin/bash
clear
START=$(date +"%s")
function ShowElapsedTime {
echo ''
end=$(date +"%s")
elapsed=$(($end-$START))
@mopsicus
mopsicus / TextGradient.cs
Last active May 12, 2020
Apply gradient to whole TMP text, but no for each character
View TextGradient.cs
// ----------------------------------------------------------------------------
// The MIT License
// TextGradient https://gist.github.com/mopsicus/9d344451ca614d7e9937bc0c6da2b21d
// Copyright (c) 2020 Mopsicus <mail@mopsicus.ru>
// ----------------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
You can’t perform that action at this time.