Skip to content

Instantly share code, notes, and snippets.

View geforester's full-sized avatar
🚀
Focusing

Roman Ilin geforester

🚀
Focusing
View GitHub Profile
@geforester
geforester / slideDown.js
Created June 16, 2020 22:22 — forked from ludder/slideDown.js
Vanilla JavaScript slideUp and slideDown functions
/*
Element to slide gets the following CSS:
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.4s ease 0s;
*/
/**
* Like jQuery's slideDown function - uses CSS3 transitions
@geforester
geforester / revo_helper.php
Last active January 31, 2023 00:05 — forked from zhabinka/revo_helper.php
snippets for Fenom MODX
// Получение любого поля ресурса произвольного ресурса
{1 | resource : 'pagetitle'}
// Текущий год
{'' | date : 'Y'}
//Условие IF
{$id == '1' ? '' : $url}
//Получение изображения через переменную с точкой ($_pls)
@geforester
geforester / addplace7.4-http.sh
Last active February 3, 2022 22:41
Script for add non MODX site
#!/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`
##############
@geforester
geforester / remove-7.4.sh
Last active February 3, 2022 23:02
Ubuntu 10.04 (nginx + php5-fpm): remove site including user & database
#!/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
@geforester
geforester / addsite-php7.0.sh
Last active February 3, 2022 23:09
Ubuntu 10.04 (nginx + php5-fpm): Install MODX 2.2 including user, virtual host, database
#!/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`
##############