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 | |
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/flectra --gecos 'flectra' --group flectra | |
sudo mkdir -p /etc/flectra && sudo mkdir /var/log/flectra/ | |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install postgresql postgresql-server-dev-9.5 build-essential python3-pillow python3-lxml python-ldap3 python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libsasl2-dev libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev -y | |
sudo git clone --depth=1 --branch=master https://github.com/flectrahq/flectra.git /opt/flectra/flectra | |
sudo chown flectra:flectra /opt/flectra/ -R && sudo chown flectra:flectra /var/log/flectra/ -R && cd /opt/flectra/flectra && sudo pip3 install -r requirements.txt | |
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/bin/node | |
cd /tmp && wget https://downloads.wkhtmltopdf.org/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && sudo gdebi -n wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && rm wkhtmltox-0.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
#!/bin/bash | |
# Requires: PHP | |
# | |
# See: https://github.com/njoannidi/phpLintBash/blob/master/phpLint | |
# | |
# Usage: | |
# | |
# ./phpLint | |
# | |
# Lint all files recursively in defaultDir |
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 | |
// Dummy YouTube Snippet for MODX by ackwa.fr : [[Youtube?id=`ugzbGxRuHtI`&auto=`true`]] | |
return (isset($id) ? '<iframe width="560" height="315" src="https://www.youtube.com/embed/'.$id.((isset($auto) && $auto) ? '?autoplay=1' : '').'" frameborder="0" allowfullscreen></iframe>' : ''); |
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 | |
/** | |
* log : A small MODX Snippet / Output Filter to log message to the MODX error log | |
* | |
* @version : 1.0.0 | |
* @see : https://gist.github.com/krismas/c321a4b3e29675424526 | |
* @name : log.php | |
* @author : g.noel@ackwa.fr | |
* @usage : [[*aTV:log]] | |
* [[+aPH:log]] |
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 | |
// Try to find the best location for PHP binary | |
$sPHP = ((isset($_SERVER['_']) && $_SERVER['_']) ? $_SERVER['_'] : (defined(PHP_BINARY) ? PHP_BINARY : (defined(PHP_BINDIR) ? PHP_BINDIR.'/php' : preg_replace(':/lib$:', '/bin/php', PHP_CONFIG_FILE_PATH)))); | |
$sPHP = (is_executable($sPHP) ? $sPHP : 'php'); | |
echo "$sPHP\n"; |
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
// 02/06/12 - Gildas - g.noel@ackwa.fr | |
// - assets/components/batcher/js/widgets/resource.grid.js patch to Add "Refresh Cache" Option | |
// 05/11/12 - Gildas - g.noel@ackwa.fr | |
// - Add custom log | |
// - Force timeout to 30s for each request | |
Batcher.grid.Resources = function(config) { | |
config = config || {}; | |
this.sm = new Ext.grid.CheckboxSelectionModel(); | |
Ext.applyIf(config,{ |
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 | |
/* | |
* A small MODX plugin to avoid refreshing - by default - the entire site cache when editing a cached resource - (c) 2012 ackwa.fr | |
* | |
* @version : 1.0.0 | |
* @see : https://gist.github.com/gists/3639503 | |
* @name : syncpage.php | |
* @author : g.noel@ackwa.fr | |
* | |
* @event : OnDocFormSave, OnDocFormPrerender |
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 | |
/* | |
* checkCode : A simple MODX output filter to convert TV code to value - (c) 2012 ackwa.fr | |
* | |
* @version : 1.0.0 | |
* @see : https://gist.github.com/gists/3487008 | |
* @name : checkCode.php | |
* @author : g.noel@ackwa.fr | |
* @usage : myTV : First==1||Second==2||Third==3 | |
* |
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 | |
/* | |
* A small MODX snippet to time other snippets - (c) 2012 ackwa.fr | |
* | |
* @see : https://gist.github.com/gists/3169775 | |
* @name : now.php | |
* @author : g.noel@ackwa.fr | |
* @usage : [[!now]] -> First call | |
* [[!now?seed=`1`]] -> subsequent calls | |
* |
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 | |
/* | |
* A small MODX snippet to extract POST, GET, SESSION & COOKIE values - (c) 2012-2016 ackwa.fr | |
* | |
* @version : 1.0.4 | |
* @see : https://gist.github.com/gists/2853625 | |
* @name : argv.php | |
* @author : g.noel@ackwa.fr | |
* @usage : [[!argv?key=`myparam`&default=`1`]] -> return the value | |
* [[!argv?key=`myparam`&default=`1`&toph=`1`]] -> set [[+argv.myparam]] |