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
// Удаление элемента из массива. | |
// String value: значение, которое необходимо найти и удалить. | |
// return: массив без удаленного элемента; false в противном случае. | |
Array.prototype.remove = function(value) { | |
var idx = this.indexOf(value); | |
if (idx != -1) { | |
// Второй параметр - число элементов, которые необходимо удалить | |
return this.splice(idx, 1); | |
} |
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
Get-ChildItem "*].mp3" -recurse | foreach {$_.delete()} |
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 | resource : 'pagetitle'} | |
// Текущий год | |
{'' | date : 'Y'} | |
//Условие IF | |
{$id == '1' ? '' : $url} | |
//Получение изображения через переменную с точкой ($_pls) |
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 | |
# MySQL root password | |
ROOTPASS='password' | |
TIMEZONE='Europe/Moscow' | |
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
############## |
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 | |
ROOTPASS='password' | |
echo "Enter username to delete:" | |
read USERNAME | |
mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost" | |
mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME" | |
rm -f /etc/nginx/sites-enabled/$USERNAME.conf |
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 | |
# MySQL root password | |
ROOTPASS='password' | |
TIMEZONE='Europe/Moscow' | |
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12` | |
############## |
NewerOlder