Not only useful in programming, regular expressions can make complex tasks easy in many different scenarios. Here is a great site for testing your regex:
http://rubular.com
| # For advice on how to change settings please see | |
| # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html | |
| [mysqld] | |
| sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES | |
| # | |
| # Include all files from the config directory | |
| # |
| <?xml version="1.0"?> | |
| <!-- | |
| /** | |
| * Magento Enterprise Edition | |
| * | |
| * NOTICE OF LICENSE | |
| * | |
| * This source file is subject to the Magento Enterprise Edition End User License Agreement | |
| * that is bundled with this package in the file LICENSE_EE.txt. | |
| * It is also available through the world-wide-web at this URL: |
| # Magento Connect 2 cache directories and files | |
| downloader/pearlib/cache/ | |
| downloader/*.cfg | |
| # Magento runtime media files | |
| media/catalog/product/cache/ | |
| media/tmp/ | |
| media/js/ | |
| media/css/ | |
| media/.thumbs/ |
| class KeyGenerator | |
| require "digest/sha1" | |
| def self.generate(length = 12) | |
| Digest::SHA1.hexdigest(Time.now.to_s + rand(567891234).to_s)[1..length] | |
| end | |
| end |
| <VirtualHost *:80> | |
| DocumentRoot "/path/to/web/files/" | |
| ServerAdmin webmaster@localhost | |
| ServerName localhost | |
| #SetEnv MAGE_IS_DEVELOPER_MODE true | |
| #SetEnv MAGE_RUN_CODE storecode | |
| #SetEnv MAGE_RUN_TYPE website | |
| <Directory "/path/to/web/files/"> |
| GRANT USAGE ON *.* TO `user`@`localhost` IDENTIFIED BY 'password'; | |
| GRANT CREATE ROUTINE, CREATE VIEW, ALTER, SHOW VIEW, CREATE, ALTER ROUTINE, INSERT, SELECT, DELETE, UPDATE, DROP, LOCK TABLES, CREATE TEMPORARY TABLES, INDEX ON `database`.* TO `user`@`localhost` IDENTIFIED BY 'password'; | |
| FLUSH PRIVILEGES; |
| # Remove items used for building, since they aren't needed anymore | |
| apt-get clean | |
| apt-get -y remove linux-headers-$(uname -r) build-essential | |
| apt-get -y autoremove | |
| # Zero out the free space to save space in the final image: | |
| dd if=/dev/zero of=/EMPTY bs=1M | |
| rm -f /EMPTY | |
| # Removing leftover leases and persistent rules |
| SET @position = 0; | |
| SET @last_parent = 0; | |
| SET @last_level = 0; | |
| DROP TABLE IF EXISTS `cce_new_position`; | |
| CREATE TEMPORARY TABLE `cce_new_position` | |
| SELECT | |
| `new`.`entity_id` AS `entity_id`, | |
| `new`.`parent_id` AS `parent_id`, | |
| @last_parent := CAST(`new`.`parent_id` AS UNSIGNED) AS `new_parent_id`, | |
| `new`.`name` AS `name`, |
| # | |
| # Basic process for merging two Git repositories while retaining commit history. | |
| # - This seems to work pretty well for migrations to Pantheon | |
| # | |
| # Clone the repository that will be the final origin | |
| git clone <repository_uri_1> <local_dir> | |
| cd <local_dir> | |
| # Add the second repository as a remote |