Skip to content

Instantly share code, notes, and snippets.

View abdo1819's full-sized avatar

abdo ragab hashem abdo1819

  • Egypt Fayoum
View GitHub Profile
@CTimmerman
CTimmerman / file_downloader.py
Last active May 2, 2024 19:11
Resume HTTP download
"""Download with automatic resume.
2018-06-28 v1.0 by Cees Timmerman
2018-07-09 v1.1 Added If-Unmodified-Since header for consistency."""
import os, shutil, sys, time
import requests # python -m pip install requests
def download_file(url, local_filename=None):
if not local_filename:
local_filename = url.split('/')[-1]
@hereismari
hereismari / msi-gtx1060-ubuntu-18.04-deeplearning.md
Last active December 3, 2023 17:14
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow
@koehlma
koehlma / modelsim.py
Last active October 25, 2022 18:54
Python interface to the ModelSim simulator.
# -*- coding: utf-8 -*-
# Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de>
"""
Python interface to the ModelSim simulator. The simulator is instrumented using FIFO pipes
such that it becomes fully controllable from within Python using TCL commands.
"""
import contextlib
@nerdsrescueme
nerdsrescueme / regex.txt
Created September 23, 2011 16:08
Common Regex
Perl and PHP Regular Expressions
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa.
//All major credit cards regex
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/'