Skip to content

Instantly share code, notes, and snippets.

View ehzawad's full-sized avatar
🎃
Wasteland Baby!

ehzawad ehzawad

🎃
Wasteland Baby!
View GitHub Profile
absl-py 1.4.0
aio-pika 8.2.3
aiofiles 23.1.0
aiogram 2.25.1
aiohttp 3.8.5
aiohttp-retry 2.8.3
aiormq 6.4.2
aiosignal 1.3.1
APScheduler 3.9.1.post1
astunparse 1.6.3
@ehzawad
ehzawad / neovim-debian.sh
Last active August 21, 2023 08:46
neovim from source
Access to the latest features of Neovim
Install Neovim in the location you wish
Installation
(1) Install the build prerequisites:
sudo apt-get install ninja-build \
gettext libtool libtool-bin \
autoconf automake cmake g++ \
pkg-config unzip
(2) Clone the Neovim repository:
import ssl
# Get the OpenSSL version
openssl_version = ssl.OPENSSL_VERSION
print(f"OpenSSL Version: {openssl_version}")
# Get the OpenSSL version info (tuple)
openssl_version_info = ssl.OPENSSL_VERSION_INFO
print(f"OpenSSL Version Info: {openssl_version_info}")
import httpx
import asyncio
from collections import OrderedDict
# async def translate_to_arabic(text):
# url = "https://google-translate1.p.rapidapi.com/language/translate/v2"
# payload = {
# "q": text,
# "target": "ar",
# "source": "en"
TensorFlow Bazel configuration file.
# This file tries to group and simplify build options for TensorFlow
#
# ----CONFIG OPTIONS----
# Android options:
# android:
# android_arm:
# android_arm64:
# android_x86:
# android_x86_64:
@ehzawad
ehzawad / mmul_samplecuda.cu
Created August 12, 2023 06:57
cuda programming
#include <stdio.h>
#include <cuda_runtime.h>
#define X 3
#define Y 6
#define Z 10
__global__ void multiplyMatrices(int *a, int *b, int *c) {
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
<!DOCTYPE html>
<html>
<head>
<style>
#images {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
grid-auto-rows: 150px;
gap: 10px;
padding: 10px;
from multiprocessing import Pool, current_process, cpu_count
import os, time
def io_bound_task(num):
start_time = time.time()
print(f"Process ID: {os.getpid()}, Process Name: {current_process().name}, Starting Task {num}")
time.sleep(2) # simulate I/O-bound task with delay
end_time = time.time()
print(f"Process ID: {os.getpid()}, Process Name: {current_process().name}, Finished Task {num}, Execution time: {end_time - start_time} seconds")
```python
import asyncio
import os
import threading
async def print_odd(max_value):
for i in range(max_value):
if i % 2 != 0:
asyncio.sleep(1)
print(i)
```bash
HOST
sudo chown 1000:1000 /home/ehzawad/python-dockerbaby/src
chmod 777 /home/ehzawad/python-dockerbaby/src
Container
ARG version=alpine
FROM python:${version} as base
# Installing basic tools