Skip to content

Instantly share code, notes, and snippets.

View MohamedElashri's full-sized avatar

Mohamed Elashri MohamedElashri

View GitHub Profile
@MohamedElashri
MohamedElashri / Zotero-Sci-hub.json
Last active August 28, 2022 23:35
Sci-Hub look up engine for Zotero. Add to zotero engines file (https://www.zotero.org/support/locate#managing_lookup_engines). Afterwards, relaunch Zotero, make sure the newly added lookup engine is checked under Locate (green arrow) -> Manage Lookup Engines.
[
{
"name": "Sci-Hub Lookup",
"alias": "Sci-Hub",
"icon": "null",
"_urlTemplate": "https://sci-hub.ru/{z:DOI}",
"description": "Sci-Hub full text PDF search",
"hidden": false,
"_urlParams": [],
"_urlNamespaces": {
@MohamedElashri
MohamedElashri / ROOT-Colab.sh
Last active February 26, 2022 08:17
This is the way to install ROOT CERN in Google Colab,.
# This code is for installing ROOT on Google Colab to be able to install root_numpy and root_pandas package later
# for version of this code which work with python3 visit
#https://gist.github.com/MohamedElashri/1b0367992988f053a02dbfd5797fb59e
!mkdir -p APPS
!pwd
!cd APPS && wget https://root.cern.ch/download/root_v6.13.08.Linux-ubuntu18-x86_64-gcc7.3.tar.gz
!cd APPS && tar -xf root_v6.13.08.Linux-ubuntu18-x86_64-gcc7.3.tar.gz
@MohamedElashri
MohamedElashri / index.html
Last active January 29, 2021 18:44
Personal Website
<header>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<title>Mohamed Elashri</title>
</header>
<!--Main Page-->
<section id="body" class="">
<!--Main Container-->
<div class="container">
<!--Menu Bar-->
<div class="main-menu" id="main-menu">
@MohamedElashri
MohamedElashri / ConvertRootCsv.py
Last active October 28, 2020 20:54
convert ROOT data to csv in a simple way using rootpy package
from rootpy.io import root_open
f=root_open('File.root')
t=f.Get('FlatTree')
t.csv()
@MohamedElashri
MohamedElashri / pypi.md
Last active March 11, 2021 08:17
[Publish python package] how to publish python package on pypi #python

create the wheel files

python setup.py sdist bdist_wheel

submit to pypi using your credentials directly

--repository take [testpypi,pypi] for testing server and actual one

python -m twine upload -u -p --repository pypi dist/*

@MohamedElashri
MohamedElashri / Zotero OCR dependencies.md
Last active April 24, 2021 05:00
Zotero OCR dependencies and how to configure them

For installing OCR engine do the following

use homebrew to install tessecrat first, this installs english and two other languages that I don't remember.

brew install tesseract-lang

Then I've the path is which depends on the version of course

/opt/homebrew/Cellar/tesseract/4.1.1

The second requirement is installing pdftoppm which comes with poppler package and can be done on two steps

@MohamedElashri
MohamedElashri / Fix.md
Last active January 30, 2021 07:01
Fix Jupyter Notebook krenel dying in Mac M1
  1. First find eventsloop.py file To get this file we user either terminal or finder to search for.

  2. Open terminal and write nano filepath/ipykernel/eventloops.py In my case it will be nano /opt/homebrew/lib/python3.9/site-packages/ipykernel/eventloops.py

  3. navigate to def _use_appnope()

@MohamedElashri
MohamedElashri / terminal.md
Last active January 30, 2021 07:05
Mac OS terminal cheat sheet #terminal

SHORTCUTS

Key/Command Description
Ctrl + A Go to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception
Ctrl + E Go to the end of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception
Ctrl + L Clears the Screen
Cmd + K Clears the Screen
Ctrl + U Cut everything backwards to beginning of line
Ctrl + K Cut everything forward to end of line
@MohamedElashri
MohamedElashri / pip_m1.md
Last active January 27, 2022 01:23
[Mac Big sur on M1 python package pip] Fix Mac Big sur on M1 python package pip cannot build wheels #python

To fix these problem until the official pip support these changes and it becomes standard for python installation and Homebrew

run the following steps in terminal

  1. brew install python@3.9 or brew re-install python@3.9

  2. brew install openblas `

  3. OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install cython --no-use-pep517

@MohamedElashri
MohamedElashri / anaconda_m1.md
Last active April 24, 2021 04:57
Anaconda on Mac M1 #python

To install and use anaconda until now

  1. run brew install anaconda

  2. to access it through zch terminal use

~/../../opt/homebrew/anaconda3/bin/conda init zsh