This file contains 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 | |
$view = preg_replace('/[^a-z]/', '', $_SERVER['REQUEST_URI']) ?: 'index'; | |
require __DIR__ . '/layout.php'; |
This file contains 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 | |
require 'validation.php'; | |
/** An example, validate the given data with given rules */ | |
$data = [ | |
'username' => 'voteforpedro', | |
'password' => '123456', | |
'confirm' => '123456', |
This file contains 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 () { | |
var view = $('#preview'), | |
elements = $('.preview-form form').find('select, input, textarea'); | |
function preview (specific) { | |
if (view.hasClass('off')) { | |
return; | |
} | |
if ( !specific ) { |
This file contains 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
/** | |
* @link http://php.net/manual/en/language.oop5.typehinting.php#111411 | |
*/ | |
function optimized_strpos ($ErrLevel, $ErrMessage) { | |
if ($ErrLevel == E_RECOVERABLE_ERROR) | |
return strpos($ErrMessage, 'must be an instance of string, string') | |
|| strpos($ErrMessage, 'must be an instance of integer, integer') | |
|| strpos($ErrMessage, 'must be an instance of float, double') | |
|| strpos($ErrMessage, 'must be an instance of boolean, boolean') | |
|| strpos($ErrMessage, 'must be an instance of resource, resource'); |
This file contains 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 MooQuery = function (query) { | |
this.elements = Array.prototype.splice.call(document.querySelectorAll(query), 0); | |
}; | |
MooQuery.prototype = { | |
constructor: MooQuery, | |
each: function (callback) { | |
this.elements.map(callback); | |
}, | |
}; |
This file contains 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 | |
/** | |
* Two functions to work with multidimensional arrays. | |
* md_get to get array value using key separated by '.' | |
* md_set to set array value using key separated by '.' | |
* Easy, huh? | |
* | |
* @author volter9 | |
*/ |