This file contains hidden or 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
| class DataObject { | |
| attach(listener) { | |
| this.listeners.push(listener); | |
| } | |
| detach(removeListener) { | |
| this.listeners = this.listeners.filter(listener => listener !== removeListener); | |
| } | |
| emit() { |
This file contains hidden or 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
| set_error_handler(function(int $severity, string $message, string $file, int $line) { | |
| if (error_reporting()) { | |
| throw new ErrorException($message, $severity, $severity, $file, $line); | |
| } | |
| }); | |
| try { | |
| user_error('Something bad happened'); | |
| } | |
| catch (ErrorException $e) |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| declare -A params=$6 # Create an associative array | |
| paramsTXT=""; | |
| if [ -n "$6" ]; then | |
| for element in "${!params[@]}" | |
| do | |
| paramsTXT="${paramsTXT} | |
| fastcgi_param ${element} ${params[$element]};" | |
| done |
This file contains hidden or 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
| sudo a2dismod php5 | |
| sudo a2enmod php7.0 | |
| sudo service apache2 restart |
This file contains hidden or 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
| sudo a2dismod php7.0 | |
| sudo a2enmod php5 | |
| sudo service apache2 restart |
This file contains hidden or 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
| # curl https://gist.githubusercontent.com/liamkeily/d339306065638c982ee1cd1db05b5362/raw/180610de0d9f171ba580af5c53fe44d5158f9912/install-composer | bash | |
| cd /tmp | |
| curl -sS https://getcomposer.org/installer | php | |
| mv composer.phar /usr/local/bin/composer |
This file contains hidden or 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
| // mv node_modules node_modules_old && npm install | |
| var fs = require('fs') | |
| var path = require('path') | |
| var node_modules = path.join(__dirname, 'node_modules') | |
| var node_modules_old = path.join(__dirname, 'node_modules_old') | |
| fs.readdir(node_modules, function(err, files) { | |
| files.forEach(function(dir) { | |
| try { |
This file contains hidden or 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
| apt-get install wkhtmltopdf | |
| apt-get install xvfb | |
| echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh | |
| chmod a+rx /usr/bin/wkhtmltopdf.sh | |
| ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf | |
| wkhtmltopdf http://www.google.com output.pdf |
This file contains hidden or 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. AddTrustExternalCARoot.crt | |
| 2. COMODORSAAddTrustCA.crt | |
| 3. COMODORSADomainValidationSecureServerCA.crt | |
| Order: 3 2 1 |