Skip to content

Instantly share code, notes, and snippets.

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

Emrul Hasan Zawad ehzawad

🎃
Wasteland Baby!
View GitHub Profile
```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
@ehzawad
ehzawad / nerd_fonts.md
Created July 28, 2023 19:10 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
@ehzawad
ehzawad / lua-stuff.lua
Created July 28, 2023 19:02
Switching to luascript from VimScript
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Kickstart.nvim is *not* a distribution.
Kickstart.nvim is a template for your own configuration.
The goal is that you can read every line of code, top-to-bottom, understand
@ehzawad
ehzawad / mind-around.js
Created July 28, 2023 13:32
yay, call stack!
setTimeout(() => console.log(1));
Promise.resolve().then(() => console.log(2));
Promise.resolve().then(() => setTimeout(() => console.log(3)));
new Promise(() => console.log(4));
setTimeout(() => console.log(5));
const fs = require('fs');
console.log(1);
console.log(2);
setTimeout(() => {
console.log('setTimeout');
}, 0);
console.log(3);
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
}
canvas {
import time
import threading
class Runner:
def __init__(self, name, sleep_time, steps):
self.name = name
self.sleep_time = sleep_time
self.steps = steps
def run(self):
@ehzawad
ehzawad / core_concept.md
Created July 16, 2023 11:53
Django Core COncept
  • models and databases
  • handling http requests
  • working with forms
  • templates
  • class-based views
  • migrations
  • managing files
  • testing in Django
  • user authentication in Django
  • Django's cache framework
def bisearch(listt, targett):
fi = 0
hi = len(my_list) - 1
while fi <= hi:
mid = (fi + hi ) // 2
if target > my_list[mid]:
fi = mid + 1
elif target < my_list[mid]: