Skip to content

Instantly share code, notes, and snippets.

View dimmduh's full-sized avatar
🎮
Learning Unity

Dmitrii Dukhnich dimmduh

🎮
Learning Unity
View GitHub Profile
@dimmduh
dimmduh / run.sh
Created February 6, 2018 03:30
How to update gitlab - ubuntu 16 - whne package 'gitlab-ce' has no installation candidate
copy text from
https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.list?os=Ubuntu&dist=xenial&source=script
put to
nano /etc/apt/sources.list.d/gitlab_gitlab-ce.list
update
gitlab-rake gitlab:backup:create STRATEGY=copy
apt-get update && sudo apt-get install gitlab-ce
@dimmduh
dimmduh / profile stats.txt
Created March 23, 2024 11:55
Unity 2023.2.10f1 available profile stats
Ai - Carving.ApplyResults - TimeNanoseconds
Ai - Carving.BuildBVTree - TimeNanoseconds
Ai - Carving.Clipping - TimeNanoseconds
Ai - Carving.ConvexHulls - TimeNanoseconds
Ai - Carving.Prepare - TimeNanoseconds
Ai - Carving.ProjectVertices - TimeNanoseconds
Ai - CollectSources - TimeNanoseconds
Ai - Colliders - TimeNanoseconds
Ai - Components.NavMeshAgent.SendMessage - TimeNanoseconds
Ai - Components.NavMeshAgent.State - TimeNanoseconds
@dimmduh
dimmduh / z_DebugPunCallbacks.cs
Created February 29, 2024 09:11
Debug Log Unity Photon Pun Callback
using System;
using System.Collections.Generic;
using ExitGames.Client.Photon;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using Hashtable = ExitGames.Client.Photon.Hashtable;
public class z_DebugPunCallbacks : MonoBehaviourPunCallbacks
{
@dimmduh
dimmduh / download photo from vk with date
Last active November 26, 2023 07:19
Скачивает фото из Вконтакте и вставляет дату в имя файла
//Download image from vk
var $ = $;
function convertImageToBase64(imgUrl, callback) {
const image = new Image();
image.crossOrigin='anonymous';
image.onload = () => {
const canvas = document.createElement('canvas');
@dimmduh
dimmduh / Nginx-1.7_vhost.conf
Last active November 15, 2023 17:09
Example nginx config for Yii 2 (advanced) for openserver
server {
listen %ip%:%httpport%;
listen %ip%:%httpsport% ssl;
server_name %host% %aliases%;
# if ($request_method !~* ^(GET|HEAD|POST)$ ){return 403;}
location ~ /\. {deny all;}
location / {
<div class="entry-content">
<p>(last update: May 20, 2016)</p>
<p>This year’s GDC was awesome. Some amazing&nbsp;presentations and again I could chat with super-smart and inspiring people. Be&nbsp;sure to check out <a href="http://32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com/wp-content/uploads/2016/03/GdcVdrLottes.pdf">“Advanced Techniques and Optimization of HDR Color Pipelines”</a>, <a href="http://www.frostbite.com/2016/03/optimizing-the-graphics-pipeline-with-compute/">“Optimizing the Graphics Pipeline with Compute”</a>&nbsp;and <a href="http://www.frostbite.com/2016/03/photogrammetry-and-star-wars-battlefront/">“Photogrammetry and Star Wars Battlefront”</a>&nbsp;. Growing list of presentations:</p>
<h1>Programming Track</h1>
<ul>
<li><a href="http://wili.cc/research/northlight_dx12/GDC16_Timonen_Northlight_DX12.pptx">“Developing The Northlight Engine: Lessons Learned”</a> –&nbsp;Ville Timonen (Remedy Entertainment)</li>
<li><a href="http://htmlpreview.github.io/?https://cdn.rawgit.com/niklasfry
@dimmduh
dimmduh / RenderTextureTo2DTexture.cs
Created February 25, 2020 18:26
unity - convert Render Texture To 2D Texture
private Texture2D RenderTextureTo2DTexture(RenderTexture rt)
{
var texture = new Texture2D(rt.width, rt.height, rt.graphicsFormat, 0, TextureCreationFlags.None);
RenderTexture.active = rt;
texture.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
texture.Apply();
RenderTexture.active = null;
[MenuItem(z_EditorPrefs.ContextMenuInHierarchyCommonPath + "/Fix Before export FBX", false)]
public static void FixBeforeExportFbx()
{
if (!Selection.activeGameObject)
{
return;
}
foreach (var gameObject in Selection.gameObjects)
@dimmduh
dimmduh / z_DarkSkyboxFix.cs
Last active December 21, 2022 09:52
Unity fix dark scene after scene loading (skybox, reflection probe)
using System.Collections;
using UnityEngine;
using UnityEngine.Rendering;
//https://forum.unity.com/threads/solved-scenemanager-loadscene-make-the-scene-darker-a-bug.542440/#post-7752681
public class z_DarkSkyboxFix : MonoBehaviour
{
IEnumerator Start()
{
if (RenderSettings.customReflectionTexture != null)
@dimmduh
dimmduh / ShaderReplacer.cs
Created March 17, 2017 09:52
automatic replace shader in unity from pc to mobile
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
public class ShaderReplacer : MonoBehaviour {
private static readonly Dictionary<string, Shader> replaceTo = new Dictionary<string, Shader>()
{
{"Legacy Shaders/Diffuse", Shader.Find("Mobile/Diffuse") },