Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
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})*$/' |
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
# https://hakibenita.com/fast-load-data-python-postgresql | |
from typing import Iterator, Dict, Any, Optional | |
from urllib.parse import urlencode | |
import datetime | |
#------------------------ Profile | |
import time |
import pyodbc | |
from datetime import datetime | |
class Sql: | |
"""Class used for establishing a Python to Microsoft SQL Server connection | |
and import/export/manipulation of data files inside the server. | |
""" | |
def __init__(self, database, server="XXVIR00012,55000"): | |
"""Here we are initialising our database and server parameters and | |
our connection to SQL server. |
import pyodbc | |
from datetime import datetime | |
class Sql: | |
def __init__(self, database, server="XXVIR00012,55000"): | |
# here we are telling python what to connect to (our SQL Server) | |
self.cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};" | |
"Server="+server+";" | |
"Database="+database+";" |
# imports for SQL data part | |
import pyodbc | |
from datetime import datetime, timedelta | |
import pandas as pd | |
# imports for sending email | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
import smtplib |