# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")References:
| $.ajax({ | |
| url: 'api/url', | |
| method: 'POST', | |
| data: {var:'val'}, | |
| // data: JSON.stringify({var:'val'}), // send data in the request body | |
| // contentType: "application/json; charset=utf-8", // if sending in the request body | |
| dataType: 'json' | |
| }).done(function(data, textStatus, jqXHR) { | |
| // because dataType is json 'data' is guaranteed to be an object | |
| console.log('done'); |
| [Unit] | |
| Description=supervisord - Supervisor process control system for UNIX | |
| Documentation=http://supervisord.org | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf | |
| ExecReload=/bin/supervisorctl reload | |
| ExecStop=/bin/supervisorctl shutdown |
| # Goto a directory you can write to: | |
| cd ~ | |
| #get composer: | |
| curl -s https://getcomposer.org/installer | php | |
| # move composer into a bin directory you control: | |
| sudo mv composer.phar /usr/local/bin/composer | |
| # double check composer works | |
| composer about |
| import axios from 'axios' | |
| import toast from './toast' | |
| function errorResponseHandler(error) { | |
| // check for errorHandle config | |
| if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) { | |
| return Promise.reject(error); | |
| } | |
| // if has response show the error |
| /** | |
| * Encryption class for encrypt/decrypt that works between programming languages. | |
| * | |
| * @author Vee Winch. | |
| * @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference. | |
| * @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here. | |
| */ | |
| class Encryption { |
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")References:
| ## | |
| ## How to install mcrypt in php7.2 / php7.3 | |
| ## Linux / MacOS / OSX | |
| ## | |
| ## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ | |
| # |
| ### NOT A SCRIPT, JUST A REFERENCE! | |
| # install dante-server | |
| sudo apt update | |
| sudo apt install dante-server | |
| # or download latest dante-server deb for Ubuntu, works for 16.04 and 18.04: | |
| wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-2build1_amd64.deb | |
| # or older version: | |
| wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb |
| <?php | |
| /** | |
| * Function: FormatCreditCard | |
| * Author : Nikhil Ben Kuruvilla | |
| * Date : 14th july 2010 | |
| */ | |
| function FormatCreditCard($cc) { | |
| // REMOVE EXTRA DATA IF ANY |
| module.exports = function(duration) { | |
| return function(){ | |
| return new Promise(function(resolve, reject){ | |
| setTimeout(function(){ | |
| resolve(); | |
| }, duration) | |
| }); | |
| }; | |
| }; |