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 / 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 / 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`
##############
@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 / 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`
##############
<div class="maininfo--content" itemscope="" itemtype="http://schema.org/ItemPage">
<span class="itemprop" itemprop="specialty">Property</span>
<span class="itemprop" itemprop="keywords">Balcony</span>
<span class="itemprop" itemprop="additionalType">http://www.productontology.org/doc/Real_estate</span>
<span class="itemprop" itemprop="description">Holly Lodge 🏠 - new home for sale. Price on request. Oakeshott Avenue, London N6 6DS</span>
<span class="itemprop" itemprop="name">Holly Lodge</span>
<span class="itemprop" itemprop="url">https://1newhomes.com/holly-lodge-london</span>
<span class="itemprop" itemprop="contentLocation" itemscope="" itemtype="http://schema.org/Place">
<span class="itemprop" itemscope="" itemprop="geo" itemtype="http://schema.org/GeoCoordinates">
@geforester
geforester / versionCleanX.php
Created September 14, 2017 16:43
Remove old versions from VersionX
<?php
/**
* versionCleanX
*
* @author Scott Pronych, September 27, 2013
*
* DESCRIPTION
*
* For use with VersionX to delete old content
*
<feed>
<building>
<building-id>121244</building-id>
<studio>
<price>10000000</price>
<area>54.4</area>
</studio>
<room-1>
<price>10000000</price>
<area>54.4</area>
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<order>Заявка №ПЛ0083229</order> <!-- Номер заявки неликвида -->
<name>Дверь открывание наружу 60 мм, Alt 100, Дверная фурнитура, 2000х860, Белый 9016, Белый 9016</name> <!-- Название -->
<price>7714</price> <!-- Цена -->
<image>items/0083229.jpg</image> <!-- Ссылка на картинку, где имя файла – номер заявки или другой уникальный id -->
<features> <!-- Список всех особенностей заявки: цвет, способы запирания, типы ручек и тп -->
<feature>
<feature-name>Тип ручки</feature-name>
@geforester
geforester / gist:547bde6b712d151463884e44165c925d
Created January 11, 2021 08:18
remove ads from mail.yandex.ru
.ns-view-infoline-box + div, .b-banner, .PSHeader-Pro, .PSHeader-Center, .mail-ProLeftColumnButton__pro-button {
display: none !important;
}