Skip to content

Instantly share code, notes, and snippets.

View TideSofDarK's full-sized avatar
🟥

Alexandr Semenov TideSofDarK

🟥
  • Burning Babies
  • Yekaterinburg, Russia
View GitHub Profile
@ruzrobert
ruzrobert / Vibration.cs
Last active September 16, 2025 07:38
Android Vibration for Unity 3D. Supports all API: 1 - 29 (auto detect), Amplitudes, Predefined Effects, both Legacy and >=26 APIs.
using System.Diagnostics.CodeAnalysis;
using UnityEngine;
// Dont forget to add "using RDG;" to the top of your script!
namespace RDG
{
/// <summary>
/// Class for controlling Vibration. Automatically initializes before scene is loaded.
/// </summary>
public static class Vibration
@ditzel
ditzel / I18n.cs
Last active April 28, 2025 09:36
Internationalization - See code comments for usage
/*
* Internationalization
*
* Author: Daniel Erdmann
*
* 1. Add this File to you Project
*
* 2. Add the language files to the folder Assets/Resources/I18n. (Filesnames: en.txt, es.txt, pt.txt, de.txt, and so on)
* Format: en.txt: es.txt:
* =============== =================
@EricTRocks
EricTRocks / UpdateJointBindPose.py
Created July 21, 2016 00:24
Updates selected Maya joint's bind pose Credit to Ryan Porter (yantor3d)
# Credit to Ryan Porter (yantor3d)
from maya import cmds
for jnt in cmds.ls(sl=True, type="joint"):
matrixPlugs = cmds.listConnections(jnt + ".worldMatrix", type="skinCluster", p=True) or []
for mp in matrixPlugs:
bindPreMatrixPlug = mp.replace('matrix', 'bindPreMatrix')
if cmds.listConnections(bindPreMatrixPlug, s=True, d=False):
@aras-p
aras-p / preprocessor_fun.h
Last active December 26, 2025 00:20
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@onevcat
onevcat / MonoSingleton.cs
Created July 18, 2013 00:37
Mono singleton Class. Extend this class to make singleton component.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Mono singleton Class. Extend this class to make singleton component.
/// Example:
/// <code>
/// public class Foo : MonoSingleton<Foo>
/// </code>. To get the instance of Foo class, use <code>Foo.instance</code>
@rjzak
rjzak / PyUtils.cpp
Last active May 15, 2024 21:06
Convert between Python list/tuples and C++ vectors
#include <Python.h> // Must be first
#include <vector>
#include <stdexcept>
#include "PyUtils.h"
using namespace std;
// =====
// LISTS
// =====