Run the following commands in shell:
rm -rf ~/.Trash/
mkdir ~/.Trash/
Then relaunch the Finder to apply permissions: Command + Option + Esc and Relaunch Finder.
| <?php | |
| /** | |
| * Loads media from a remote site when on a local dev environment. | |
| * Eliminates the need to download the uploads directory from the remote site for testing purposes. | |
| * Replace WEBSITE with you domain name. | |
| */ | |
| if ('WEBSITE.local' === $_SERVER['HTTP_HOST']) : | |
| add_filter('upload_dir', function ($uploads) { | |
| $uploads['baseurl'] = 'https:/WEBSITE.com/wp-content/uploads'; |
| #!/bin/bash | |
| # Dependencies: vips | |
| # Homebrew: brew install vips | |
| for file in *.pdf | |
| do | |
| # Run vips pdfload for options | |
| # You could add --page=1 to get the second page (from 0) or --dpi=300, etc. to get different quality images | |
| # The variable gets the filename without the extension | |
| vips pdfload ${file%.*}.pdf ${file%.*}.jpg | |
| done |
| <?php | |
| /** | |
| * Build Comma-Separated String | |
| * Won't add a hanging comma if there's only passed value | |
| */ | |
| function comma_separated($array) { | |
| $string = implode(', ', $array); | |
| if (preg_match("/, $/", $string)) { // if it ends in a comma, remove the comma | |
| $string = substr($string, 0, -2); | |
| } |
| <?php | |
| /** | |
| * Build a name | |
| */ | |
| function build_name($prefix, $fname, $lname, $suffix) { | |
| $name = $fname . ' ' . $lname; | |
| if($prefix) $name = $prefix . ' ' . $name; | |
| if($suffix) $name = $name .= $suffix; | |
| return $name; | |
| } |
| <?php | |
| /** | |
| * FacetWP Pager Bootstrap 4 Pagination | |
| * @source https://gist.github.com/MWDelaney/ce9e523b3f1bdf57b3180c9b24b73170 | |
| * @source https://fellowtuts.com/bootstrap/wordpress-pagination-bootstrap-4-style/ | |
| */ | |
| add_filter('facetwp_pager_html', function ($output, $params) { | |
| $range = 2; // +/- pages from the current page | |
| $showitems = ($range * 2) + 1; | |
| $page = $params['page']; |
| <?php | |
| add_filter('facetwp_facet_html', function ($output, $params) { | |
| if ('dropdown' == $params['facet']['type']) { | |
| $output = preg_replace("/( \([0-9]+\))/m", '', $output); | |
| } | |
| return $output; | |
| }, 10, 2); |
| AL : Alabama | |
| AK : Alaska | |
| AS : American Samoa | |
| AZ : Arizona | |
| AR : Arkansas | |
| CA : California | |
| CO : Colorado | |
| CT : Connecticut | |
| DE : Delaware | |
| DC : District of Columbia |
Sage 9 is the latest and greatest from Roots, but the build process is much more complicated than Sage 8 (i.e. gulp --production and profit). The following took me quite a bit of time to figure out, but is probably not comprehensive. Please comment if you need clarity. I hope it saves you some time!
Deploybot allows you to create your own containers. Go to Settings > Containers > Create a container. Based off the Ubuntu 16.04 container add the following build commands and save as Sage 9:
🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!
This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.
sudo nano /etc/ssl/localhost/localhost.conf