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 | |
| /** | |
| * Class ModActiveRecord is the base class for classes representing relational data. | |
| * It provides methods to check if attributes were modified | |
| * | |
| * @author [email protected] | |
| * @link http://copi.st/JtvJ | |
| * @link http://www.yiiframework.com/extension/mod-active-record/ | |
| * |
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 | |
| // Include tlc lib | |
| require_once WPMU_PLUGIN_DIR . '/wp-tlc-transients/tlc-transients.php'; | |
| /** | |
| * Use in place of `get_posts` | |
| * | |
| * @param array $args Array of get_posts arguments | |
| * @param integer $time Amount of time before cache expires |
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
| echo "Creating an SSH key for you..." | |
| ssh-keygen -t rsa | |
| echo "Please add this public key to Github \n" | |
| echo "https://github.com/account/ssh \n" | |
| read -p "Press [Enter] key after this..." | |
| echo "Installing xcode-stuff" | |
| xcode-select --install |
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
| ################################################################ | |
| # Example configuration file for nginx | |
| # | |
| # To add a new local WordPress domain to your environment, copy | |
| # this file using a filename that matches the domain you wish to | |
| # setup. For example - mylocaldomain.com.conf would be an ideal | |
| # filename for http://mylocaldomain.com | |
| # | |
| # Once copied, you will need to modify two settings in the server | |
| # configuration provided: |
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
| # | |
| # Cutting the rss-post-aggregate plugin and its history out of a (wp-content) repo | |
| # | |
| # clone wp-content repo to a folder named for the plugin | |
| $ git clone [email protected]:/your-organization/your-wp-content-repo.git rss-post-aggregator | |
| # Remove original origin remote (won't be needed) | |
| $ git remote rm origin |
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
| #Get the size of each table, ordered by largest to smallest | |
| SELECT table_name AS "Tables", | |
| round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
| FROM information_schema.TABLES | |
| WHERE table_schema = "YOU+TABLE+NAME+HERE" | |
| ORDER BY (data_length + index_length) DESC; | |
| #Get the size of the entire DB | |
| SELECT table_schema "DB Name", | |
| Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" |
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
| # first, set | |
| # | |
| # http.compression: true | |
| # | |
| # in config/elasticsearch.yml | |
| curl -XDELETE 'localhost:9200/test' | |
| rm -f content.json content.json.gz | |
| echo '{"content":"Hello World"}' > content.json |
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
| # brew install siege | |
| # -c/--concurrent == number of concurrent requests | |
| # -r/--reps == number of times to run the test | |
| siege -c 10 -r 10 -b "http://www.domain.com/" | |
| # Note: doesn't always work with SSL endpoints with self-signed certs | |
| # using Apache Ab in a Docker container seems to do the trick though | |
| # see https://gist.github.com/Integralist/01815f7abc7d18a97341 |