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 / README.md
Last active March 25, 2023 21:43
Streamlit + Flask example

A simple example for Streamlit and Flask project

  • server.py contains the API code for the Flask server (back-end)
  • main.py contains the streamlit code (front-end)

Requirements

pip install plotly streamlit pandas requests flask
@ma7dev
ma7dev / vscode-jupyter-remote.md
Last active February 8, 2023 12:57
How to use a remote Jupyter notebook in VS code

To run access a remote jupyter notebook, you will need to do the following:

  1. Setting ssh config file (~/.ssh/config):
Host FLIP # access point server
    HostName access.engr.oregonstate.edu
    User ONIDusername
Host DGX # target server
    HostName submit-b.hpc.engr.oregonstate.edu
    User ONIDusername
@ma7dev
ma7dev / commit.git
Created November 23, 2022 19:29
git commit template
type(scope): Subject
##################################################
# type:
# feat - A new feature
# fix - A bug fix
# chore - Other changes that don't modify src or test files
# build - Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
# refactor - Refactoring a specific section of the codebase
# ci - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
# perf - A code change that improves performance
@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 / index.html
Last active September 15, 2022 06:20
MSN Twitch alert - credit for the main code and design (https://codepen.io/abakos)
<html>
<head>
<title>
</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="app__notification" style="display: block;">
<div class="app__notification__title">
<img class="app__notification__title--icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAACXBIWXMAAAsSAAALEgHS3X78AAACDUlEQVR42n2RT0jTARTH32+/9dtsc38cFTaTlktcNhdD3WgmbsTSRm3qthq5DRyzwxxbDYok2r+igzPtD6Qs2jLnUDGi3KFLBJ26dOlQE+oWFB26SAaB31ILKst3eI/H4/Pe971HLMvS38YjPu1U1VIFJ9xQ2yoS/5Yx62GHSkmBjP+JN2HH/g49RGKxnjYzPssn92jEOfexiMR8CntdftTuM4HZDJLIZNQ9kcClF7NwZwuochZQ1xaFgM8oWIYh3r9oAceRxnZkbrc/AEVPBvLOEhqNHvx3CvOzjUqjJvNpB+qsNjTbPJDLpIeIYclubCBTfc1GsKXLQOlnyWPJmTy6w8MwBlxQtRrx+IJLiMn+kffnLRBwwkXisbw1wHHmBE1/ePBl6tMMRksLaLE+hK73HkZCXuCOG19TVnyOGrBNKlmXqz3cStfflZb6ijlcWywiX55HV7CAms7b8Dl8+JaxYOVyG8pBA7hKBYjjbyHn2NlTxlQWDbEhpF/mkHw+heNXJ7DLnkG9OYLX5w5gaUiNp6lmECN6S1VyKVnjsWXtwF2YUjH0L2TgnRxD+5VxKAfC4PUcxaOCGSg3YTZ78oc03ps1eUrVnmW1RodGy0G4b16EZ/wG2uM5dMTvQ5sOwReJYPqWD006/eo+FX9cr1IsocHB6Cun
@ma7dev
ma7dev / cool_script.sh
Last active September 5, 2022 13:23
takes requirements.txt file without module versions and annotates it with the latest set of module versions that won't result in build/runtime errors.
#!/bin/bash
# TODO: you will need to have conda installed
# create a python environment
conda create -n env_tmp python=3.8.13 -y
# activate environment
conda activate env_tmp
[tool.poetry]
name = "env_test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "3.8.13"
[tool.poetry.dev-dependencies]

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 / _.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 / 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