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
| # save this file to /etc/nginx/forge-conf/example.com/server/ | |
| client_max_body_size 100m; |
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
| #Copy/paste this into the "Before This Action" hook of "Activate New Release" | |
| cd {{release}} | |
| # choose the directory dynamically in case of upgrade | |
| wordPressDirectory=$(ls -d ../../../wordpress-*/ | tail -1) | |
| ln -s ${wordPressDirectory}index.php . | |
| ln -s ${wordPressDirectory}wp-activate.php . | |
| ln -s ${wordPressDirectory}wp-admin/ . | |
| ln -s ${wordPressDirectory}wp-blog-header.php . |
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
| location ~* /(.*\.pdf) { | |
| types { application/octet-stream .pdf; } | |
| default_type application/octet-stream; | |
| } |
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
| # THis is for WordPress subdirectory multsite | |
| rewrite ^/(wp-.*.php)$ /wp/$1 last; | |
| rewrite ^/(wp-(content|admin|includes).*) /wp/$1 last; | |
| if (!-e $request_filename) { | |
| rewrite /wp-admin$ $scheme://$host$uri/ permanent; | |
| rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) /wp$1 last; | |
| rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ /wp$1 last; | |
| } |
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 BlogController extends Controller | |
| { | |
| /** | |
| * Posts | |
| * | |
| * @return void | |
| */ | |
| public function showPosts() |
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
| #!/bin/bash | |
| # Usage: generatecert.sh domainname.dev | |
| # Generates a key and self signed certificate, then requires Linux Chrome to trust the certificate | |
| # Dependency: libnss3-tools (sudo apt install libnss3-tools) | |
| if (( $EUID != 0 )); then | |
| echo "Please run again with sudo" | |
| exit | |
| fi |
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 | |
| $wp = new GuzzleHttp\Client(); | |
| $request = $wp->get('http://www.example.com/wp-json/wp/v2/users'); | |
| $statusCode = $request->getStatusCode(); | |
| if($statusCode >= 200 && $statusCode < 300 ) { | |
| $users = json_decode($request->getBody()); | |
| foreach($users as $user) { | |
| //var_dump($user->id); | |
| //var_dump($user->name); | |
| //var_dump($user->slug); |
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
| #!/usb/bin/env python | |
| import os | |
| import dropbox | |
| import shutil | |
| import zipfile | |
| # Create a dropbox app and obtain App Key and Secret Key. Specify a folder | |
| # Create a folder called romsync in your specified Dropbox app folder | |
| # Store Dropbox App Key and Secret Key in system environment variables |
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
| #!/bin/bash | |
| for site in `wp site list --field=url`; do | |
| wp media regenerate --yes --url=$site | |
| done | |
| ~ |