This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var source = require('vinyl-source-stream'); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require('browserify'); | |
| var watchify = require('watchify'); | |
| var babel = require('babelify'); | |
| function compile(watch) { | |
| var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Function to check email validity | |
| function checkEmail($email) { | |
| if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { | |
| // Email invalid because wrong number of characters or @s | |
| return false; | |
| } | |
| // Split it into sections to make shit easy | |
| $email_array = explode("@", $email); | |
| $local_array = explode(".", $email_array[0]); | |
| for ($i = 0; $i < sizeof($local_array); $i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function is_valid_luhn($number) { | |
| settype($number, 'string'); | |
| $sumTable = array( | |
| array(0,1,2,3,4,5,6,7,8,9), | |
| array(0,2,4,6,8,1,3,5,7,9)); | |
| $sum = 0; | |
| $flip = 0; | |
| for ($i = strlen($number) - 1; $i >= 0; $i--) { | |
| $sum += $sumTable[$flip++ & 0x1][$number[$i]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class DB{ | |
| private $link; | |
| function __construct( $config ){ | |
| extract( $config ); | |
| $this->link = mysqli_connect( $host, $user, $pass, $name, $port ) OR die( mysqli_connect_errno() ); | |
| } |