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
| function get_partial($t) { | |
| include( locate_template( 'template_parts/'.$t.'.php', false, false ) ); | |
| } |
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
| switch_themes | |
| edit_themes | |
| edit_theme_options | |
| install_themes | |
| activate_plugins | |
| edit_plugins | |
| install_plugins | |
| edit_users | |
| edit_files | |
| manage_options |
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
| # converts an mp4 to webm | |
| ffmpeg -i input-file.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output-file.webm | |
| # grabs the first frame of the video for using as the <video> poster | |
| ffmpeg -i input-file.mp4 -vframes 1 -f image2 video-poster.jpg |
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
| - index: | |
| - paged: | |
| - archive: | |
| - author: | |
| - author-$id: | |
| - author-$nicename | |
| - category: | |
| - category-$id: | |
| - category-$slug | |
| - archive-$posttype |
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
| var templateHierarchy = [ | |
| { | |
| "index": [ | |
| { | |
| "paged": [ | |
| { | |
| "archive": [ | |
| { | |
| "author": [ | |
| { |
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
| # Querying a relationship field (stored as a serialized array) | |
| # https://www.advancedcustomfields.com/resources/querying-relationship-fields/ | |
| $related_posts = get_posts([ | |
| 'post_type' => ['publication'], | |
| 'posts_per_page' => 6, | |
| 'meta_query' => [ | |
| [ | |
| 'key' => 'related_research_area', | |
| 'value' => $cur_id, |
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 | |
| # Return the histogram | |
| fileToWrite="./colors.csv" | |
| filename="" | |
| regex='(\d+): ' | |
| if [ "$1" != "" ]; then # Test for positional argument | |
| if [ -f "$1" ]; then # Test if regular file, not directory | |
| filename="$1" |
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
| <VirtualHost *:80> | |
| # The ServerName directive sets the request scheme, hostname and port that | |
| # the server uses to identify itself. This is used when creating | |
| # redirection URLs. In the context of virtual hosts, the ServerName | |
| # specifies what hostname must appear in the request's Host: header to | |
| # match this virtual host. For the default virtual host (this file) this | |
| # value is not decisive as it is used as a last resort host regardless. | |
| # However, you must set it for any further virtual host explicitly. | |
| #ServerName www.example.com |
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
| VAGRANTFILE_API_VERSION = "2" | |
| ## Configuration ## | |
| site_title = myvar = ENV['SITENAME'] || "wordpress" | |
| php_version = ENV['VERSION'] || "7.0" | |
| generate_wp_config_local = ENV['GENERATE'] || true | |
| ## End Configuration ## |
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
| --- | |
| - hosts: all | |
| become: true | |
| tasks: | |
| - name: set hostname | |
| command: hostnamectl set-hostname {{sitetitle}}.local | |
| - name: restart hostname |