This file contains 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 "translates" PHP module package names into system-specific names. | |
*/ | |
define puphpet::php::module ( | |
$service_autorestart | |
){ | |
$package = $::osfamily ? { | |
'Debian' => { |
This file contains 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 communities = new Bloodhound({ | |
datumTokenizer: function(datum) { | |
return Bloodhound.tokenizers.whitespace(datum.title); | |
}, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
prefetch: { | |
cache: false, | |
url: '/wp-json/wp/v2/communities', | |
filter: function(response) { | |
return $.map(response, function(community) { |
This file contains 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
server { | |
listen [::]:80; | |
listen 80; | |
# listen on both hosts | |
server_name donaldallen.com www.donaldallen.com; | |
# and redirect to the https host (declared below) | |
# avoiding http://www -> https://www -> https:// chain. | |
return 301 https://www.donaldallen.com$request_uri; |
This file contains 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 | |
add_filter('rewrite_rules_array', function ($rules) { | |
$new_rules = []; | |
$new_rules['^locations/(.+?)/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]&area=$matches[3]'; | |
$new_rules['^locations/(.+?)/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]&locations=$matches[3]'; | |
$new_rules['^locations/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&locations=$matches[2]'; | |
$new_rules['^locations/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]'; | |
$new_rules['^locations/(.+?)/?$'] = 'index.php?area=$matches[1]'; |
This file contains 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
server { | |
listen 80; | |
root /var/www/mywebsite.ca/public; | |
index index.php index.html index.htm; | |
server_name www.mywebsite.ca mywebsite.ca; | |
location ~ \.php$ { | |
fastcgi_keep_conn on; |
This file contains 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 | |
add_filter('body_class', function($classes) { | |
global $wpdb, $post; | |
if (is_page()) { | |
if ($post->post_parent) { | |
$parent = end(get_post_ancestors($current_page_id)); | |
} else { | |
$parent = $post->ID; | |
} | |
$post_data = get_post($parent, ARRAY_A); |
This file contains 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
// From this | |
section.divisions:not(.hero) { | |
padding:3em 3em; | |
background-color:$greyLighter; | |
text-align:center; | |
a { | |
display:block; | |
color:$greyDark; | |
font-size:em(14); |
This file contains 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 | |
// My rewrite | |
$our_thinking_structure = 'our-thinking/%category%/%postname%'; | |
$wp_rewrite->add_permastruct('our_thinking', $our_thinking_structure, false); | |
// Going to /our-thinking/scenarios/a-spirit-of-entrepreneurship/ works just fine. | |
// But going to /our-thinking/scenarios/ tries to load an archive page. | |
// Can I get it to load the page I have set in WP instead? |
This file contains 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
$leader_structure = '/performance/leaders/%leader%'; | |
$wp_rewrite->add_rewrite_tag("%leader%", '([^/]+)', "leader="); | |
$wp_rewrite->add_permastruct('leader', $leader_structure, false); | |
// Works | |
http://test.dev/?leader=from-basement-startup-to-global-force#more-118 | |
// Doesn't work | |
http://test.dev/performance/leaders/from-basement-startup-to-global-force |
This file contains 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
<article role="article" itemscope itemtype="http://schema.org/BlogPosting"> | |
<img src="someimage.jpg"> | |
<header> | |
<h5><a href="#">TedX Edmonton Story (21pt)</a></h5> | |
<p><time itemprop="dateCreated" datetime="2013-10-12">Wednesday, October 12, 2013</time></p> | |
</header> | |
<p>15/24pt Velit auctor aliquet. Aenean sollicitudin, lorem quis bibendum auctor, nisi elit consequat ipsum, nec sagittis sem nibh id elit. Duis sed odio sit amet nibh vulputate cursus a sit amet mauris. Morbi accumsan ipsum velit. Nam nec tellus a odio tincidunt auctor a ornare odio himenaeos.</p> |