Skip to content

Instantly share code, notes, and snippets.

@alexandre-mbm
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandre-mbm/fa14cb39c72511458acf to your computer and use it in GitHub Desktop.
Save alexandre-mbm/fa14cb39c72511458acf to your computer and use it in GitHub Desktop.
<?php
// se o arquivo não pode ser lido ou nao existe a função fopen retorna FALSE
$file = @fopen($argv[1], "r");
$ca = '';
// FALSE a partir do fopen irá causar um warning(aviso) e resultar em um loop infinito aqui
do {
$c = fgetc($file);
if($c === false) break;
$ca = $c;
} while (!feof($file));
fclose($file);
if($ca == "\n")
exit(0);
else
exit(1);
?>
alexandre$ find -type f | grep -v ".git\/" | xargs -n1 | xargs -I@ bash -c "php eof.php @ || echo @"
./.gitignore
./themes/bootstrap/README.md
./themes/bootstrap/assets/img/glyphicons-halflings-white.png
./themes/bootstrap/assets/img/glyphicons-halflings.png
./themes/bootstrap/assets/js/bootstrap.min.js
./themes/bootstrap/assets/.DS_Store
./themes/index.html
./themes/default/scripts/modernizr-2.6.1.min.js
./changelog.txt
./plugins/index.html
./vendor/index.html
./vendor/heroku/heroku-buildpack-php/.gitignore
./vendor/heroku/heroku-buildpack-php/conf/php/conf.d/ext-mongo.ini
./vendor/heroku/heroku-buildpack-php/conf/php/conf.d/ext-apcu.ini
./vendor/heroku/heroku-buildpack-php/conf/php/conf.d/ext-memcached.ini
./vendor/heroku/heroku-buildpack-php/conf/php/conf.d/ext-redis.ini
./vendor/heroku/heroku-buildpack-php/conf/php/conf.d/ext-imagick.ini
./vendor/heroku/heroku-buildpack-php/conf/nginx/heroku.conf.php
./vendor/heroku/heroku-buildpack-php/LICENSE
./vendor/heroku/heroku-buildpack-php/requirements.txt
./vendor/heroku/heroku-buildpack-php/bin/common.sh
./vendor/michelf/php-markdown/Michelf/Markdown.php
./vendor/michelf/php-markdown/Michelf/MarkdownExtra.php
./license.txt
./content/index.html
./content/404.md
./content/sub/index.md
./content/sub/page.md
./teste.txt
./lib/index.html
./composer.phar
alexandre$
alexandre$ echo >> ./content/index.html
alexandre$ echo >> ./content/404.md
alexandre$ echo >> ./content/sub/index.md
alexandre$ echo >> ./content/sub/page.md
alexandre$ git diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment