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 | |
namespace App\Logging; | |
use Illuminate\Log\Events\MessageLogged; | |
use Monolog\Logger; | |
use Logspot\Client; | |
class LogspotDriver | |
{ |
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
# Change to the project directory | |
cd /home/forge/domain.com | |
# Turn on maintenance mode | |
php artisan down || true | |
# Pull the latest changes from the git repository | |
# git reset --hard | |
# git clean -df | |
git pull origin master |
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
document.getElementById('search-submit').onclick = function() { | |
gtag('event', 'homepage_search', { | |
'event_category': 'Search', | |
'event_action': 'submit', | |
'event_label': 'Homepage Search' | |
}); | |
}; |
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
/* code inspired by Luciano Mammino via http://bit.ly/1KoCOjM */ | |
'use strict'; | |
var util = require('util'); | |
var path = require('path'); | |
var Bot = require('slackbots'); | |
var WP = require( 'wordpress-rest-api' ); | |
/** |
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
'use strict'; | |
var WP = require( 'wordpress-rest-api' ); | |
var wp = new WP({ endpoint: 'http://local.dev/wp-json/' }); | |
var Bot = require('slackbots'); | |
var settings = { | |
token: XXXX, | |
name: 'kramerbot' | |
}; |
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 | |
/** | |
* Plugin Name: WP Slack REST API Backend | |
* Description: An example of using the WordPress REST API as a backend for a Slack Bot | |
* Author: Andy Brudtkuhl | |
* Author URI: http://youmetandy.com | |
* Version: 0.1 | |
* Plugin URI: https://github.com/abrudtkuhl/heykramer | |
* License: GPL2+ |
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
'use strict'; | |
var messages = [ | |
'Giddyup', | |
'Isosceles. You know, I love the name Isosceles. If I had a kid, I would name him Isosceles. Isosceles Kramer.', | |
'You know what you are? You’re an anti-dentite! It starts with a few jokes and slurs… ‘HEY DENTY!’ Then you will say that dentists should have their own schools!', | |
'Have you ever met a proctologist? They usually have a very good sense of humor. You meet a proctologist at a party, don’t walk away. Plant yourself there because you will hear the funniest stories you’ve ever heard.', | |
'What do you think Junior? You think these hands – they’ve been soaking in Ivory Liquid?', | |
'http://i.giphy.com/aMh59aKR8vjdC.gif' | |
]; |
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 | |
/** | |
* Plugin Name: WP Slack Slash Command Example | |
* Description: An example of using the WordPress REST API as a backend for a Slack Slash Command | |
* Author: Andy Brudtkuhl | |
* Author URI: http://youmetandy.com | |
* Version: 0.1 | |
* Plugin URI: https://github.com/abrudtkuhl/wp-slack-slash-command | |
* License: GPL2+ |
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 | |
// CATEGORY SINGLE TEMPLATES :: single-{category_slug}.php | |
add_filter( 'single_template', | |
create_function( '$t', 'foreach( (array) get_the_category() as $cat ) { | |
if ( file_exists(TEMPLATEPATH . "/single-{$cat->slug}.php") ) return TEMPLATEPATH . "/single-{$cat->slug}.php"; | |
} return $t;' ) ); | |
// Example |
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
// create a new Post in WordPress | |
var post = new Post | |
{ | |
PostType = "post", // "post" or "page" | |
Title = "Using WordPressSharp", | |
Content = "WordPressSharp is a C# utility for interfacing with the WordPress XML-RPC API", | |
PublishDateTime = DateTime.Now, | |
Status = "publish" // "draft" or "publish" | |
}; |
NewerOlder