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
class AS_select{ | |
constructor($selector){ | |
if (typeof $selector == 'object') { | |
this.selector = [$selector]; | |
}else{ | |
this.selector = document.querySelectorAll($selector); | |
} |
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 | |
$dateToTest = date( 'Y-m-d' ); | |
$lastday = date('t',strtotime($dateToTest)); | |
echo $lastday; | |
?> |
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 | |
$text = '121/*-+df5481234!@$(*)_+_)--))><?":<LOP><?php echo "sdsdsd"; ?>)+(((__===----------988888s'; | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\pL\d]+~u', '-', $text); | |
// transliterate | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); |
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
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Ubuntu 16.04 Dev Server | |
# Run like - bash install_lamp.sh | |
# Script should auto terminate on errors | |
echo -e "\e[96m Adding PPA \e[39m" | |
sudo add-apt-repository -y ppa:ondrej/apache2 |
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 multid_sort($arr, $index) { | |
$b = array(); | |
$c = array(); | |
foreach ($arr as $key => $value) { | |
$b[$key] = $value[$index]; | |
} | |
asort($b); | |
foreach ($b as $key => $value) { |
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 | |
class Permission { | |
public function get_all_roll_cap() | |
{ | |
return [ | |
'admin' => [ | |
'title' => 'Admin', | |
'capabilities' => [ |
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
// Post to the provided URL with the specified parameters. | |
function post(path, parameters) { | |
var form = $('<form></form>'); | |
form.attr("method", "post"); | |
form.attr("action", path); | |
$.each(parameters, function(key, value) { | |
var field = $('<input></input>'); |
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
1: install xdm (Xtreme Download Manager) | |
sudo add-apt-repository ppa:noobslab/apps | |
sudo apt-get update | |
sudo apt-get install xdman-downloader |
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
preg_match("/^[a-zA-Z0-9\s]{2,25}$/", "", $FirstName) | |
preg_match("/^[a-zA-Z0-9\s]{2,25}$/", "", $LastName) |
NewerOlder