Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| #!/usr/bin/env ruby | |
| # Aside from removing Ruby on Rails specific code this is taken verbatim from | |
| # mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome | |
| # - Ryan Florence (http://ryanflorence.com) | |
| # | |
| # Install this hook to a remote repository with a working tree, when you push | |
| # to it, this hook will reset the head so the files are updated | |
| if ENV['GIT_DIR'] == '.' |
| web/bundles/ | |
| app/bootstrap* | |
| app/cache/* | |
| app/logs/* | |
| vendor/ | |
| app/config/parameters.ini |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| # Automated Deployments from Bitbucket/Github Service Hook | |
| # Graciously borrowed from: http://brandonsummers.name/blog/2012/02/10/using-bitbucket-for-automated-deployments/ | |
| date_default_timezone_set('America/Chicago'); | |
| class Deploy { | |
| /** | |
| * A callback function to call after the deploy has finished. |
| <?php | |
| // To the extent possible under law, I (Stephan Sokolow) waive all copyright and related or | |
| // neighbouring rights to this code snippet. (Though it'd still be nice if you mention me) | |
| // If we're running under `php -S` with PHP 5.4.0+ | |
| if (php_sapi_name() == 'cli-server') { | |
| // Replicate the effects of basic "index.php"-hiding mod_rewrite rules | |
| // Tested working under FatFreeFramework 2.0.6 through 2.0.12. | |
| $_SERVER['SCRIPT_NAME'] = str_replace(__DIR__, '', __FILE__); |
| {# | |
| Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/ | |
| Updated by: Simon Schick <simonsimcity@gmail.com> | |
| Parameters: | |
| * currentFilters (array) : associative array that contains the current route-arguments | |
| * currentPage (int) : the current page you are in | |
| * paginationPath (string) : the route name to use for links | |
| * showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled) | |
| * lastPage (int) : represents the total number of existing pages |
| # For each database: | |
| ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; | |
| # For each table: | |
| ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
| # For each column: | |
| ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
| # (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.) |
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
Hanging out in subtitling and video re-editing communities, I see my fair share of novice video editors and video encoders, and see plenty of them make the classic beginner mistakes when it comes to working with videos. A man can only read "Use Handbrake to convert your mkv to an mp4 :)" so many times before losing it, so I am writing this article to channel the resulting psychic damage into something productive.
If you are new to working with videos (or, let's face it, even if you aren't), please read through this guide to avoid making mistakes that can cost you lots of computing power, storage space, or video quality.