Skip to content

Instantly share code, notes, and snippets.

View ma7dev's full-sized avatar
🧘
.

Mazen ma7dev

🧘
.
View GitHub Profile
@ma7dev
ma7dev / test_sorting.py
Created April 25, 2022 10:30
Testing sorted()
import random
def naive_way_of_sorting(arr):
for i in range(len(arr)):
for j in range(i+1, len(arr)):
if arr[i] > arr[j]:
arr[i], arr[j] = arr[j], arr[i]
return arr
def test_sorting(size):
@ma7dev
ma7dev / _.md
Last active July 19, 2022 13:23
Mazen's way of learning

How I learn

Consume the content

When I read from an article, PDF, or any text-based resource, I follow the following rules:

  • Use two highlightning colors (orange and green) and alternate between them to separate ideas.
  • After reading for sometime or feel that I have lost or might lose track of what I have read before, I come back and write marginal notes (in red) to describe the general idea for each highlighted section.
  • After completing reading the content, I revisit my notes and try to have a solid understanding of the content and add more marginal notes with a different color (blue).
  • Re-write my notes and general ideas into a piece of paper to understand the flow of ideas (just focus on important things and ignore details that aren't important)
@ma7dev
ma7dev / notes.md
Last active January 23, 2022 05:06
Sudo Group's Weekly Meeting Notes

Sudo Group's Weekly Meeting Notes

Join our community of people interested in Software Engineering. link

#10 - How to write good code?

Host: @sudomaze

Note-taker: @h7lc0n (notes)

@ma7dev
ma7dev / main.ipynb
Last active January 4, 2022 16:53
Enabling/Disabling xkcd drawing style in Matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ma7dev
ma7dev / blockchain.py
Created November 19, 2021 06:21
A blockchain made from scratch in ~50 lines
# source: https://twitter.com/PrasoonPratham/status/1461267623266635778/photo/1 (@PrasoonPratham on Twitter)
import datetime
import hashlib
class Block:
def __init__(self, data):
self.data = data
self.blockNo = 0
self.next = None
self.nonce = 0

Sudomaze - Currently working on

Today

  • Lab 02a: PyTorch Lightning
  • Lab 02b: Training a CNN on Synthetic Handwriting Data
  • Lab 03: Transformers and Paragraphs
  • srush/Tensor-Puzzles: Solve puzzles. Improve your pytorch.

@ma7dev
ma7dev / main.ipynb
Last active January 14, 2022 07:51
Refactored code from Effective Pandas by Matt Harrison talk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ma7dev
ma7dev / README.md
Last active August 12, 2021 08:21
Quick and play PyTorch Profiler example

Intro

It wasn't obvious on PyTorch's documentation of how to use PyTorch Profiler (as of today, 8/12/2021), so I have spent some time to understand how to use it and this gist contains a simple example to use.

Instructions

  • Install the required packages:
python>=1.9.0
torchvision>=0.10.0
numpy
matplotlib
@ma7dev
ma7dev / ngrok.yml
Last active November 16, 2022 16:35 — forked from maximiliano/ngrok.yml
Ngrok, running multiple ports at once (works for free version)
# Create 4 tunnels, each for different ports, with only https enabled
# This way the ngrok process stays bellow the Free plan limit (4 tunnels)
# command: ngrok start --all # to start all of them
# command: ngrok start note tb # to run jupyter notebook server and tensorboard server only
# refer to this page for more info: https://ngrok.com/docs#multiple-tunnels
authtoken: ...
log: ngrok.log
tunnels:
# to run jupyter notebook server
@ma7dev
ma7dev / ci.yaml
Created July 7, 2021 20:58
Example for my jobs setup
name: Automated Experiments
on:
push:
branches: [ main ]
jobs:
build_on_cn-gpu5:
runs-on: [ cn-gpu5 ]
timeout-minutes: 4320
defaults:
run: