Skip to content

Instantly share code, notes, and snippets.

View daviddarke's full-sized avatar
🚀

David Darke daviddarke

🚀
View GitHub Profile
@daviddarke
daviddarke / update.sh
Created April 2, 2017 21:27
Search and update all Wordpress composer sites
for d in *; do
if [[ -d $d ]]; then
if [ -f $d/wp-config.php ]; then
siteName=`basename "$d"`
# See if there is a composer file inside the site folder
if [ -f $d/composer.json ]; then
echo " - Updating $siteName"
# echo "Installing Capistrano"
# /home/vagrant/.rbenv/shims/gem install capistrano -q
#
# echo "Updating Composer"
# sudo composer self-update --quiet
echo "*/20 * * * * ~/cron-run.sh >> ~/cron.log 2>&1" >> ~/mycron
# cp /var/www/atomic-scotch-box/* ~/
@daviddarke
daviddarke / wp-cron
Created November 4, 2016 13:43
Add this cron job
*/1 * * * * wget http://www.domain.com/wp-cron.php?doing_wp_cron 2>&1 > /dev/nul
@daviddarke
daviddarke / wp-cron-disable
Last active November 4, 2016 13:29
Disable WP-CRON
define( 'DISABLE_WP_CRON', true );
@daviddarke
daviddarke / structured-data-include.php
Created October 4, 2016 08:25
Wordpress version of Google's structured data
<?php
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_image_src( $post_thumbnail_id );
?>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
{% include 'jsonld/structured-data-single.twig' %}
@daviddarke
daviddarke / structured-data-single.twig
Last active September 23, 2016 09:04
Used for adding structured data to blog post in wordpress
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{post.link}}"
},
"headline": "{{ post.title }}",
"image": {
@daviddarke
daviddarke / update-all-sites.sh
Last active September 19, 2016 12:49
Update all local sites running composer
#!/bin/bash
find . -maxdepth 2 -name 'composer.json' -exec bash -c 'site=$(dirname '{}') && composer update --prefer-dist --working-dir=$site' \;
<!-- End thumbnails -->
{% assign my_content_array_start = pages.global-blocks.content | split: "<p>[[extraArtBlock start]]</p>" %}
{% assign my_content_array_end = my_content_array_start[1] | split: "<p>[[extraArtBlock end]]</p>" %}
{{ my_content_array_end[0] }}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->