Skip to content

Instantly share code, notes, and snippets.

View ajnaduvil's full-sized avatar
💥

Albin Jose ajnaduvil

💥
  • Kochi
View GitHub Profile
@ajnaduvil
ajnaduvil / add_open_in_cursor_context_menu.bat
Last active September 15, 2024 06:59
Adds "Open in Cursor" to the Windows context menu for files and folders. Update CURSOR_PATH and run as admin.
@echo off
REM Batch file to add "Open in Cursor" to the context menu for files, folders, and folder backgrounds
REM Define the path to the Cursor executable
set "CURSOR_PATH=C:\Users\Albin\AppData\Local\Programs\cursor\Cursor.exe"
REM Define the path to the batch file that opens files in Cursor
set "BATCH_FILE_PATH=C:\Scripts\open_in_cursor.bat"
REM Create the directory for the batch file if it doesn't exist
@ajnaduvil
ajnaduvil / EditorStatus.cs
Created March 29, 2024 07:46
Check if Unity editor is busy
public class EditorStatus
{
public static bool IsEditorBusy()
{
return EditorApplication.isCompiling ||
EditorApplication.isPlayingOrWillChangePlaymode ||
EditorApplication.isUpdating ||
EditorApplication.isSceneOpening ||
AssetDatabase.IsAssetImportWorkerBusy();
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScalpXServiceLocator : Singleton<ScalpXServiceLocator>
{
/// <summary>
/// currently registered services.
/// </summary>
@ajnaduvil
ajnaduvil / DeepCloneExtentionMethod.cs
Last active May 15, 2022 06:21
Deep clone using binary serialization
/// <summary>
/// A faster implementation of deepclone using binary formatter
/// </summary>
/// <param name="obj">Object to be cloned</param>
/// <returns></returns>
public static T DeepClone<T>(this T obj)
{
using (var ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
@ajnaduvil
ajnaduvil / DeepCloneExtentionMethod.cs
Created May 15, 2022 06:18
Deep clone using binary serialization
/// <summary>
/// A faster implementation of deepclone using binary formatter
/// </summary>
/// <param name="obj">Object to be cloned</param>
/// <returns></returns>
public static T DeepClone<T>(this T obj)
{
using (var ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
@ajnaduvil
ajnaduvil / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console