Skip to content

Instantly share code, notes, and snippets.

View modond's full-sized avatar

Monique de Haas modond

View GitHub Profile
import sys
import mailbox
import email
import quopri
import json
import time
from BeautifulSoup import BeautifulSoup
from dateutil.parser import parse
MBOX = 'mtsw-test-messages.mbox'
@modond
modond / email Validation
Created July 19, 2013 14:37
Validating email with JS
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\
".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA
-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
<?php
$host="localhost"; //replace with your hostname
$username="database_example"; //replace with your username
$password="Password"; //replace with your password
$db_name="MyMovies"; //replace with your database
$con=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name") or die ("cannot select DB");
$sql = "select * from BestMovies"; //replace with your table name
$result = mysql_query($sql);
$json = array();