# find and group by extension
# http://serverfault.com/a/183432/128858
find ./ -type f -not -path "./.git/*" | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n 1 .GIF
1 .JPG
1 .bash
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
| # Safer pushes. Other values: nothing, matching, upstream, simple | |
| git config --local push.default current | |
| # colorize output (Git 1.5.5 or later) | |
| git config --local color.ui auto | |
| # and from 1.5.4 onwards, this will works: | |
| git config --local color.interactive auto | |
| # better colors for spotting whitespace |
- https://www.npmjs.com/package/db-migrate
- https://phinx.org/ - https://github.com/robmorgan/phinx
- https://github.com/gwa/MySQL2Phinx
- http://www.liquibase.org/
- http://off-scale.com/
- http://dbdeploy.com/
- https://github.com/tpalko/php-mysql-database-migrator
- http://www.phpactiverecord.org/
- http://schemasync.org/
Talks about Web Performance by Anthony Hatzopoulos at Real Estate Webmasters Summit Conference Events:
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
| # download wtf somewhere in your path and make it executable | |
| curl https://raw.githubusercontent.com/hatzopoulos/wtf/entropy/wtf.py > ~/bin/wtf.py && chmod 0755 !#:3 | |
| # declare a function similar to | |
| wtf-find() { | |
| find "${@: -1}" -not \( -name .svn -prune -o -name .git -prune \ | |
| -o -name .hg -prune \) -type f -exec bash -c \ | |
| 'grep -Il "" "$1" &>/dev/null && wtf.py '"${*:1:$#-1}"' "$1"' _ {} \; | |
| } |
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
| <?php | |
| $content = '<img data-should-not-get-stripped src="https://example.com/example.jpg" alt="Not a real image." width="630" height="420">'; | |
| echo $content.PHP_EOL.str_repeat('-', 40).PHP_EOL; | |
| $content = preg_replace( | |
| "/<img(?! (data-src|data-img-src|data-orig))([^']*?) src=\"([^']*?)\"([^']*?)>/", | |
| '<img$2$1 data-img-src="$3" src="/r/1.2.3/t.gif'.'"$4>', | |
| $content | |
| ); |
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
| ## All Stats | |
| curl -o /dev/null -s -w "\n\ | |
| url_effective: %{url_effective}\n\ | |
| http_code: %{http_code}\n\ | |
| http_connect: %{http_connect}\n\ | |
| time_namelookup: %{time_namelookup}\n\ | |
| time_connect: %{time_connect}\n\ | |
| time_appconnect: %{time_appconnect}\n\ | |
| time_pretransfer: %{time_pretransfer}\n\ | |
| time_redirect: %{time_redirect}\n\ |
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
| <?php | |
| ob_start(); | |
| // 503 Header | |
| header('HTTP/1.1 503 Service Temporarily Unavailable', true, 503); | |
| // Retry-After header. Two examples of its use are: | |
| // 1. Retry-After: 120 | |
| header('Retry-After: '.(1 * 60 * 60)); | |
| // 2. Retry-After: Fri, 31 Dec 1999 23:59:59 GMT |