Skip to content

Instantly share code, notes, and snippets.

@nicloay
nicloay / Singleton.cs
Last active February 2, 2018 08:44
Unity3d singleton
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{
static T _instance;
static readonly object _lock = new object();
public static bool Initialized()
{
@Abdelhady
Abdelhady / DeviceOrientation
Last active April 29, 2023 05:16
A utility class to help get current device orientation, you will need it if you decided to fix the activity's orientation in the manifest :)
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.ExifInterface;
/**
* Created by abdelhady on 9/23/14.
*
* to use this class do the following 3 steps in your activity:
@arikfr
arikfr / .monitrc
Created December 13, 2010 14:35
Setting Monit to work with Gmail as mail server
set mailserver smtp.gmail.com port 587 username "user@domain.com" password "password" using tlsv1 with timeout 30 seconds