Skip to content

Instantly share code, notes, and snippets.

View kargaranamir's full-sized avatar
🕸️
Focusing

Amir Hossein Kargaran kargaranamir

🕸️
Focusing
View GitHub Profile
@kargaranamir
kargaranamir / myhref.md
Last active August 22, 2021 17:43
Create Custom Command Latex

Here is a simple custom command for adding underline to href package. Also there are another ways to do this but it's a good example to show how we can create a custom command!

\newcommand{\myhref}[2]{%
    \href{#1}{\underline{#2}}%
}
@kargaranamir
kargaranamir / setup.py
Created September 3, 2021 14:57
setup.py to install cpython extention xxx.so
from distutils.core import setup
setup (name = 'xxx',
version = '1.0',
author = "author_xxx",
description = """Desciption""",
py_modules = ["xxx"],
packages=[''],
package_data={'': ['_xxx.so']},
)
@kargaranamir
kargaranamir / rtl.md
Created December 11, 2021 14:06
RTL Markdown

این گونه عنوان بزرگ را تعیین کنید

این گونه عنوان کوچکتر را تعیین کنید

برای ارجاع دادن به لینک از این قالب استفاده کنید.

@kargaranamir
kargaranamir / acm_copyright.md
Created January 25, 2022 19:17
How to remove the copyright box? in acm format
@kargaranamir
kargaranamir / screen-resolution.md
Created June 14, 2022 08:56
Desktop, Mobile, Tablet, Console Screen Resolution Data From https://gs.statcounter.com/screen-resolution-stats
[{'height': '2340', 'width': '1080', 'xusage': ['Mobile', 'Console']},
 {'height': '1920', 'width': '1080', 'xusage': ['Mobile']},
 {'height': '1440', 'width': '2560', 'xusage': ['Desktop', 'Console']},
 {'height': '1366', 'width': '1024', 'xusage': ['Tablet', 'Desktop']},
 {'height': '1280', 'width': '800', 'xusage': ['Tablet']},
 {'height': '1280', 'width': '720', 'xusage': ['Mobile']},
 {'height': '1200', 'width': '1920', 'xusage': ['Desktop']},
 {'height': '1194', 'width': '834', 'xusage': ['Tablet']},
 {'height': '1152', 'width': '2048', 'xusage': ['Desktop']},
@kargaranamir
kargaranamir / even_2prime_conjecture.ipynb
Last active July 21, 2022 18:52
even_2prime_conjecture.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kargaranamir
kargaranamir / Google_colab_python3_9_or_python3_10.ipynb
Last active January 3, 2023 15:05
Use different version of Python in Google Colab (Python 3.9 or Python 3.10)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import csv
file = open('vocab_first_column_persian_second_column_english')
csvreader = csv.reader(file)
start_b = "آ"
for header in csvreader:
start_a = header[0].strip()[0]
if start_a !=start_b:
@kargaranamir
kargaranamir / cispa-prof-pellegrino-challenge.ipynb
Last active February 2, 2023 18:24
cispa-prof-pellegrino-challenge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kargaranamir
kargaranamir / find.md
Created March 10, 2023 22:09
Recursively find all files that match a certain pattern

Find files with ./XXX/XXX.md pattern:

find . -regex '.*/*/[^/]*.md'

Find number of files with ./XXX/XXX.md pattern:

find . -regex '.*/*/[^/]*.md' -printf '%i\n' | wc -l