Skip to content

Instantly share code, notes, and snippets.

@habedi
habedi / unity-maming-conventions.md
Last active December 13, 2024 22:28
Naming conventions for #Unity projects

Unity Naming Conventions

Using consistent naming conventions in Unity projects helps keep everything organized and easy to work with. Below is a list of recommended conventions for naming components, scripts, variables, methods, folders, and game objects in a Unity project.


General Rules

  1. PascalCase for Classes:
  • Use PascalCase for class names (e.g., PlayerController, GameManager).
@habedi
habedi / CreateUnityProjectStructure.ps1
Last active January 24, 2025 08:55
A PowerShell script to create a Unity project struture (execute: `.\CreateUnityProjectStructure.ps1` in PoweShell to run)
# This script creates a basic Unity project structure in the current directory.
# To run the script, open a PowerShell terminal and execute the following command:
# .\CreateUnityProjectStructure.ps1
param(
[string]$BaseDir = (Get-Location).Path
)
# Function to create a directory and handle errors
function Create-Dir {
@habedi
habedi / get_tables_info.sql
Last active December 12, 2024 10:23
Get the information about the amount of storage used for tables (works for #mysql, #mariadb, #postgres)
-- Note that numbers are estimates, so the exact number of rows or index size might slightly differ from the number shown
-- For MySQL or MariaDB
select
table_name as `table name`,
table_rows as `row count`,
round(data_length / (1024 * 1024 * 1024), 2) as `data size (gb)`,
round(index_length / (1024 * 1024 * 1024), 2) as `index size (gb)`,
round((data_length + index_length) / (1024 * 1024 * 1024), 2) as `total size (gb)`
from
@habedi
habedi / install_game_deps.sh
Last active December 3, 2024 22:55
This script installs a few dependency libraries for Linux games #videogame #dependency #script
#!/bin/bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libopenal1:i386 libgtk2.0-0:i386 libvkd3d1 gamemode # gamemode:i386
#sudo apt install gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-bad:i386 gstreamer1.0-plugins-ugly:i386 gstreamer1.0-libav:i386
# OpenSSL 1.0
@habedi
habedi / gdrive_downloader.py
Last active September 2, 2024 15:52
A Python script to download data in Google Spreadsheet files stored in Google Drive #python #google_drive #CSV
import argparse
import json
import re
from pathlib import Path
import gspread
import pandas as pd
from getfilelistpy import getfilelist
from google.oauth2 import service_account
from tqdm import tqdm
@habedi
habedi / make_aws_access_keys.sh
Last active August 31, 2024 17:43
A simple Bash script for creating temporary AWS access keys using the aws-azure-login tool (see https://github.com/aws-azure-login/aws-azure-login) #aws #saml #azure_sso
#!/bin/bash
# Description: This script will create the AWS access keys using the Azure account credentials.
# First, run the docker container (code below) and then enter the Azure account credentials.
# The AWS access keys will be created and stored in the ~/.aws/credentials file in the host machine.
docker run -it --rm \
--name aws-azure-login \
--workdir /root \
-v ${HOME}/.aws:/root/.aws \
@habedi
habedi / openai_connector.py
Created June 11, 2024 08:43
Example OpenAI connector code
from typing import Any
import numpy as np
import openai
from numpy import ndarray, dtype
class LanguageModels:
"""Enum for the supported language models."""
OPENAI_GPT35TURBO = 'gpt-3.5-turbo'
OPENAI_GPT4O = 'gpt-4o'
@habedi
habedi / download_kaggle_dataset.sh
Created April 3, 2024 05:49
A Bash script to download Kaggle datasets using the Kaggle API
#!/bin/bash
# Download a dataset or competition data from Kaggle using the Kaggle API
# Usage: download_kaggle_dataset.sh <type> <dataset-name> <output_dir>
# Arguments:
# type: The type of the Kaggle data to download. Either '-d' or 'dataset' for dataset, or '-c' or 'competition' for competition.
# dataset-name: The name of the dataset or competition on Kaggle. For datasets, it should be in the format 'username/dataset-name'.
# output_dir: The directory where the data will be downloaded and extracted.
# Examples:
@habedi
habedi / install_useful_cli_tools.sh
Last active December 14, 2024 22:24
A Bash script to install a collection of (very) useful CLI tools and programs
#!/bin/bash
# List of the packages to be installed and their descriptions
packages=(
"duf:Disk Usage/Free Utility"
"fzf:A general-purpose command-line fuzzy finder"
"bpytop:Resource monitor that shows usage and stats for processor, memory, disks, network and processes"
"htop:Interactive process viewer"
"nano:Easy-to-use text editor"
"tmux:A terminal multiplexer"
@habedi
habedi / my_template_colab_notebook_v1.ipynb
Last active April 11, 2024 07:44
A template notebook to be used in the Google Colab environment
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.