Skip to content

Instantly share code, notes, and snippets.

View ma7dev's full-sized avatar
🏗️
say/do <<< 1/2

Mazen ma7dev

🏗️
say/do <<< 1/2
View GitHub Profile
@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:
@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 / 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
@ma7dev
ma7dev / multithreading.ipynb
Created April 3, 2021 02:21
Multi-threading skeleton code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ma7dev
ma7dev / main.ipynb
Last active January 4, 2022 16:53
Enabling/Disabling xkcd drawing style in Matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ma7dev
ma7dev / main.ipynb
Last active January 14, 2022 07:51
Refactored code from Effective Pandas by Matt Harrison talk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / README.md
Created June 7, 2022 01:18
Store and Install VSCode extensions

VSCode

# conda env export > environment. yml
code --list-extensions > requirements.txt

# conda env create --file environment.yml
./install.sh
@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)