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 / 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"
@dezashibi
dezashibi / custom_bash_prompt.sh
Last active July 30, 2024 08:33
Quick and small snippet to customize bash prompt
# the addition is the `parse_git_branch` function, the colorizing and the order of shown data
parse_git_branch() {
git branch 2>/dev/null | grep '*' | sed 's/* //'
}
# refer to the structure of your bashrc and change it accordingly
if [ "$color_prompt" = yes ]; then
PS1='\[\033[00m\]┌\[\033[01;36m\]\t \[\033[01;34m\]\w\[\033[00m\]\n${debian_chroot:+($debian_chroot)}└\[\033[01;32m\]\u (\[\033[01;33m\]$(parse_git_branch)\[\033[01;32m\])\$ \[\033[00m\]'
else
PS1='┌\t \w\n${debian_chroot:+($debian_chroot)}└\u ($(parse_git_branch))\$ '
fn main() {
{
let args: Vec<String> = std::env::args().collect();
if args.len() < 2 {
eprintln!("Usage: todo &lt;command&gt; [arguments]");
return;
}
let command = &args[1];
match command.as_str() {
"add" => add_todo(),
@dezashibi
dezashibi / wasm4_wasm32.odin
Created April 4, 2024 09:33 — forked from gingerBill/wasm4_wasm32.odin
WASM-4 Odin bindings
// WASM-4: https://wasm4.org/docs
package wasm4
foreign import wasm4 "env"
#assert(size_of(int) == size_of(u32))
// ┌───────────────────────────────────────────────────────────────────────────┐
// │ │
// │ Platform Constants │