Skip to content

Instantly share code, notes, and snippets.

View dezashibi's full-sized avatar
🎯
Focusing on my targets

Navid Dezashibi dezashibi

🎯
Focusing on my targets
View GitHub Profile
@dezashibi
dezashibi / CameraTargetSingleton.cs
Created March 13, 2025 05:18 — forked from JohnnyTurbo/CameraTargetSingleton.cs
Scripts from tutorial: Tutorial: SURVIVORS-LIKE w/ Unity DOTS & ECS - https://youtu.be/cc5l66FwpQ4
using UnityEngine;
namespace TMG.Survivors
{
public class CameraTargetSingleton : MonoBehaviour
{
public static CameraTargetSingleton Instance;
public void Awake()
{
/*
The purpose of this plugin is to disable certain procedures that are intended to be
developer-only secret code that you don't want to end up in the final release build
of your program.
To use this plugin, compile your program with `jai main.jai -plug Developer_Only`
and then mark certain procedures with the `@Developer` note. These procedures will
have their body deleted when in developer builds.
// Handle-based array. Used like this:
//
// EntityHandle :: distinct Handle
// entities: HandleArray(Entity, EntityHandle)
//
// It expects the type used (in this case Entity) to contains a field called handle
// of type Handle
//
// You can then fetch entities using ha_get() and add handles using ha_add()
@dezashibi
dezashibi / how_to_fix_installation_error.md
Last active August 21, 2024 07:22
Install Homebrew on OSX

First things first

Follow the standard way of running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If it worked well bingo, bango! but if some fatal: ref... error happened or it stucked at the final stage of installation with similar error:

/*******************************************************************************************
*
* raylib [core] example - fullscreen toggle
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
@dezashibi
dezashibi / windows_posix_utf8_characters.c
Created August 6, 2024 08:40
Get Unicode (UTF8) characters working in C for Windows and POSIX
#include <locale.h>
#include <stddef.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#if defined(_WIN32) || defined(_WIN64)
#include <Windows.h>
#define LOCALE_STR ".UTF-8"
#else
@dezashibi
dezashibi / main.cpp
Created August 6, 2024 03:29 — forked from mtvee/main.cpp
cross platform socket example c/c++
#include<cstdio>
#include<cstring>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include<unistd.h>
@dezashibi
dezashibi / get_home_dir.c
Created August 5, 2024 07:54
Get user's home directory on Windows and POSIX operating systems
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
#include <windows.h>
#endif
const char* get_home_directory()
{
#ifdef _WIN32
@dezashibi
dezashibi / update.bat
Created August 1, 2024 12:13
Git pull in all the child folders (windows and linux)
for /d %%d in (*) do (cd %%d && if exist .git (git pull) && cd ..)
@dezashibi
dezashibi / Microsoft.Powershel_profile.ps1
Last active August 1, 2024 04:31
My Powershell prompt settings, open this by running `notepad.exe $profile` in powershell, add the content, save then enter ". $profile"
function Get-GitBranch {
$branch = & git rev-parse --abbrev-ref HEAD 2>$null
if ($LASTEXITCODE -eq 0) {
return "($branch)"
}
return ""
}
function Prompt {
$currentTime = Get-Date -Format "HH:mm:ss"