find -D rates . -type f \( -name '*.gif' -o -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) -print -exec bash -c 'identify "$1" &> /dev/null || echo "$1" >> invalid-imgs.log' none {} \;
forked & modified from:
#!/bin/bash | |
HOST=$1 | |
shift | |
for ARG in "$@" | |
do | |
nmap -Pn --host-timeout 100 --max-retries 0 -p $ARG $HOST | |
done |
find -D rates . -type f \( -name '*.gif' -o -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) -print -exec bash -c 'identify "$1" &> /dev/null || echo "$1" >> invalid-imgs.log' none {} \;
forked & modified from:
/* | |
* Available context bindings: | |
* COLUMNS List<DataColumn> | |
* ROWS Iterable<DataRow> | |
* OUT { append() } | |
* FORMATTER { format(row, col); formatValue(Object, col) } | |
* TRANSPOSED Boolean | |
* plus ALL_COLUMNS, TABLE, DIALECT | |
* | |
* where: |
<?php | |
class DateTimeImmutabilityExample | |
{ | |
private $date; | |
/** | |
* Intentionaly no type hinting so you can test with both DateTime and DateTimeImmutable | |
*/ | |
public function __construct($date) |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
#!/bin/bash | |
PHP_EXT_DIR=$(grep extension_dir= `which php-config` | sed s/extension_dir=\'// | sed s/\'//) | |
echo $PHP_EXT_DIR |
#!/bin/bash | |
## THIS IS THE OLD WAY | |
## Nowadays, simply follow the Compose installation instructions in the official documentation: | |
## https://docs.docker.com/compose/install/ | |
# get latest docker compose released tag | |
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4) |
<?php | |
function convert($size) | |
{ | |
$unit=array('b','kb','mb','gb','tb','pb'); | |
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | |
} | |
convert(memory_get_usage()); |
Open Terminal Ctrl+Alt+T
Download Firefox Developer Edition tar file
wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US
Copy tar file to opt
sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2
Open opt
folder (cd /opt/
) and untar file
sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2
<?php | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
class CsvController extends Controller | |
{ | |
/** | |
* Get a CSV file from an array |