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 / 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 │
@dezashibi
dezashibi / 0 Odin debugging on windows.md
Created April 2, 2024 05:26 — forked from RednibCoding/0 Odin debugging on windows.md
Odin debugging on windows with vscode. See: readme

To setup debugging for Odin programs on Windows with VsCode follow these steps:

  • make sure you have the C/C++ extension pack (VsCode extension) installed
  • create a .vscode folder at the root of your Odin project
  • copy the launch.json and tasks.json into it
  • click on the debug tab in VsCode, then click on the debug button at the top (or press F5)
@dezashibi
dezashibi / audio_uploader.html
Created February 25, 2024 11:32
upload recorded audio HTML/JS only
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Record and Upload Audio</title>
</head>
<body>
<h2>Record and Upload Audio</h2>
<button id="startBtn">Start Recording</button>
<button id="stopBtn" disabled>Stop Recording</button>
@dezashibi
dezashibi / detect_client_operating_system.html
Created February 24, 2024 05:59
How to detect client operating system in javascript, Got from: https://tecadmin.net/demo/javascript-detect-os.html
<!DOCTYPE html>
<html>
<head>
<title>OS Detection</title>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
@dezashibi
dezashibi / win_lib_finder.h
Created October 3, 2023 07:21
to find the folders that contain libraries you may need to link against, on Windows
// Author: Jonathan Blow
// Version: 2
// Date: 7 May, 2019 (update to original version released on 31 August, 2018).
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
//
@dezashibi
dezashibi / open_source_licenses.md
Created November 15, 2022 04:20 — forked from nicolasdao/open_source_licenses.md
What you need to know to choose an open source license.
@dezashibi
dezashibi / getopt.c
Created April 8, 2022 11:09 — forked from ashelly/getopt.c
"Port of GNU getopt() to Win32 for anyone who's tired of dealing with getopt() calls in Unix-to-Windows ports." Ported by Pete Wilson. Recovered from the Internet Archive's snapshot of www.pwilson.net/sample.html.
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to [email protected]
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@dezashibi
dezashibi / ABOUT.md
Created April 6, 2022 16:35 — forked from laobubu/ABOUT.md
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913