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 () { | |
let password = document.getElementById("password"); | |
let confirmPass = document.getElementById("confirm_password"); | |
let submit = document.getElementById("submit"); | |
function isPasswordStrong() { | |
const pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/g; | |
return pattern.test(password.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
#!/bin/sh | |
echo "Waiting for postgres..." | |
while ! nc -z database 5432; do | |
sleep 0.1 | |
done | |
echo "PostgreSQL started" |
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
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
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 | |
$max_file_size = 5*1024*1024; //5MB | |
$path = "admin/upload/"; // Upload directory | |
//$count = 0; // nr.successfully uploaded files | |
$valid_formats = array("rar","zip","7z","pdf","xlsx","xls","docx","doc","txt"); | |
$valid_formats_server = array( | |
"application/pdf", | |
"application/octet-stream", |
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 | |
//Loop through each file | |
for($i=0; $i<count($_FILES['files']['name']); $i++) { | |
//Get the temp file path | |
$tmpFilePath = $_FILES['files']['tmp_name'][$i]; | |
//Make sure we have a filepath | |
if ($tmpFilePath != ""){ | |
//Setup our new file path | |
$newFilePath = "admin/upload/" . $_FILES['files']['name'][$i]; |
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
@charset "utf-8"; | |
@import "reset.css"; | |
/* GLOBAL CSS | |
-------------------------------------------------- */ | |
/* RESPONSIVE CSS | |
-------------------------------------------------- */ |
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 | |
function array2json($arr) { | |
$parts = array(); | |
$is_list = false; | |
if (!is_array($arr)) return; | |
if (count($arr)<1) return '{}'; | |
//Find out if the given array is a numerical array | |
$keys = array_keys($arr); |
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 | |
if(isset($_GET['id']) && $_GET['id'] != ''){ | |
$usr_dir = "upload/".$_GET['id']."/"; | |
$error = ""; | |
//checking if zip module loaded | |
if(extension_loaded('zip')){ | |
$zip = new ZipArchive(); // подгружаем библиотеку zip | |
$zip_name = time().".zip"; // имя файла | |
if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ |
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
<script> | |
function unique(arr) { | |
var obj = {}; | |
for(var i=0; i<arr.length; i++) { | |
var str = arr[i]; | |
obj[str] = true; // запомнить строку в виде свойства объекта | |
} | |
return Object.keys(obj); // или собрать ключи перебором для IE<9 |
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 getURLParameter(name) { | |
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; | |
} |
NewerOlder