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 / make_exe.bat
Last active January 15, 2022 09:10
make_exe.bat C release mode compiler for gcc in windows
@ECHO OFF
IF "%~1"=="" GOTO noargs
mingw32-gcc.exe -Wall -O2 -c %1.c -o %1.o
mingw32-g++.exe -o %1.exe %1.o -s
PAUSE
GOTO endprogram
@dezashibi
dezashibi / wclwn.md
Created March 9, 2022 09:57 — forked from zacharycarter/wclwn.md
Binding to C Libraries with Nim
@dezashibi
dezashibi / urlshort.nim
Created March 18, 2022 14:30 — forked from xmonader/urlshort.nim
urlshort.nim
# nimshorturl
# Copyright xmonader
# nim url shortening service
import jester, asyncdispatch, htmlgen, json, os, strutils, strformat, db_sqlite
# hostname can be something configurable "http://ni.m:5000"
let hostname = "localhost:5000"
var theDb : DbConn
if not fileExists("/tmp/mytest.db"):
theDb = open("/tmp/mytest.db", "", "", "")
theDb.exec(sql("""create table urls (
@dezashibi
dezashibi / neomuttrc
Created March 28, 2022 11:03 — forked from VladimirPal/neomuttrc
Minimal neomutt config for gmail imap
set imap_user="mail.vpal@gmail.com"
set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'`
set folder=imaps://imap.gmail.com/
set spoolfile=+INBOX
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# https://www.neomutt.org/guide/reference search sleep_time for additional info
set sleep_time=0 # be faster
@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
@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 drepper@gnu.org
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 / 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 / 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 / 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 / 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>