-
Getting help
- podman --help
- podman <subcommand> --help
- man podman
- man podman-<subcommand>
-
Searching, pulling & listing images
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
# Make sure you have already installed apache and mysql; | |
# install rails | |
# https://help.ubuntu.com/lts/serverguide/ruby-on-rails.html | |
sudo apt install rails | |
# install comman dependencies | |
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev make libmysqlclient-dev imagemagick \ | |
libmagickcore-dev libmagickwand-dev |
- Scalar type definitions: they come in two flavours: coercive (default) and strict. The following types for parameters can now be enforced (either coercively or strictly): strings (string), integers (int), floating-point numbers (float), and booleans (bool). They augment the other types introduced in PHP 5: class names, interfaces, array and callable.
- https://blog.programster.org/php-strict-types
- Typed pass-by-reference Parameters gotcha: Declared types of reference parameters are checked on function entry, but not when the function returns, so after the function had returned, the argument's type may have changed. For example:
<?php function array_baz(array &$param) {
$param = 1;
- https://insight.symfony.com/
- https://github.com/Roave/Dont
- https://github.com/Roave/you-are-using-it-wrong
- https://github.com/vimeo/psalm
- https://github.com/hirak/prestissimo
- https://github.com/rectorphp/rector
- https://github.com/thephpleague/pipeline
- https://github.com/lstrojny/functional-php
- https://github.com/ziadoz/awesome-php/blob/master/README.md#testing (Testing Tools: PHPUnit preferred)
- https://github.com/ziadoz/awesome-php/blob/master/README.md#continuous-integration (CI Tools: Travis preferred)
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 | |
function rmdirRecursive(string $dir) { | |
$iter = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); | |
$it = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::CHILD_FIRST); | |
foreach($it as $file) { | |
if ($file->isDir()) { |
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 | |
#Removes old revisions of snaps | |
#CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done | |
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 | |
//This isset optimization is not suitable for arrays that contains null values. | |
/* | |
$a = array('a' => null); | |
isset($a['a']); // Will be FALSE | |
array_key_exists('a', $a); // Will be TRUE | |
*/ | |
$total = 10000; | |
$paragraph = 'this is a sentence. Crud! $$$$!'; |
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
// Tested with jQuery v3.3.1 | |
$( document ).ready(function() { | |
var doVisualUpdates = true; | |
document.addEventListener('visibilitychange', function(){ | |
doVisualUpdates = !document.hidden; | |
}); | |
// code below changes the background every 10 seconds for the div with id back-overlay-slider |
- Make sure xdebug is enabled in your php installation
- The following lines worked for me in my php.ini with PHP 7.2 on Windows 10
[xdebug]
zend_extension ="php_xdebug-2.6.1-7.2-vc15-x86_64.dll"
;xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
;xdebug.remote_host=127.0.0.1
;xdebug.remote_port=9000
See https://cheatsheetseries.owasp.org/, it's more comprehensive and up to date
- Strong passwords are used.
- Passwords stored safely.
- register_globals is disabled.
NewerOlder