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 | |
public static function sendMessage($sMessage){ | |
$webhookurl = 'https://hooks.slack.com/services/WEBHOOK'; | |
$timestamp = date("c", strtotime("now")); | |
$json_data = json_encode([ | |
// Message | |
"text" => $sMessage |
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
// ==UserScript== | |
// @name Gitwebmarkdown | |
// @version 0.1 | |
// @description renders readme files in markdown | |
// @include http://yourserverhere.com/git/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js | |
// @require http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js | |
// ==/UserScript== | |
var converter = new Showdown.converter(); |
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
angular.module('myApp', ['ngRoute']) | |
.provider('Weather', function() { | |
var apiKey = ""; | |
this.getUrl = function(type, ext) { | |
return "http://api.wunderground.com/api/" + | |
this.apiKey + "/" + type + "/q/" + | |
ext + '.json'; | |
}; |
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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Silent Flush | |
* Description: Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten. | |
* Version: 2013.05.04 | |
* Author: Thomas Scholz <[email protected]> | |
* Author URI: http://toscho.de | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ |
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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Spam Block | |
* Description: Block spam before it reaches the database. | |
* Plugin URI: https://github.com/toscho/T5-Spam-Block | |
* Version: 2013.03.31 | |
* Author: Thomas Scholz | |
* Author URI: http://toscho.de | |
* Licence: MIT | |
* License URI: http://opensource.org/licenses/MIT |
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
add_action( 'wp_footer', 'count_statuses' ); | |
function count_statuses() | |
{ | |
$status = 'status'; | |
$num = get_term_post_count_by_type( "post-format-$status", 'post_format' ); | |
print "<pre>{$status}es: $num</pre>"; | |
} | |
/** | |
* Count all post in a term. |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (WCM) Debug Register Post Type Args | |
* Description: Shows the arguments of a newly registered post type right after it was | |
* registered. Helps inspecting which defaults have been added by core and if | |
* one of the developers arguments got overwritten. Simply add | |
* <code>&debug_pt_args=true</code> to your URL and set | |
* <code>WP_DEBUG</code> to <code>TRUE</code> in your <code>wp-config.php</code>. | |
* Plugin URl: http://wordpress.stackexchange.com/questions/89066 |
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: (#67107) »kaiser« Restrict file upload via image dimensions | |
*/ | |
function wpse67107_restrict_upload( $file ) | |
{ | |
$file_data = getimagesize( $file ); | |
// Abort when we can't get any info: | |
if ( ! $file_data ) |
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
function tcb_filter_search( $term ) { | |
if ( is_search() ) | |
$search = "(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; | |
return $search; | |
} | |
add_filter( 'posts_search', 'tcb_filter_search', null, 2 ); |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: SysBot | |
* Description: Creates and maintains the SysBot User (which has the role of "editor") | |
* Author: Franz Josef Kaiser | |
*/ | |
# PUBLIC API # | |
function get_bot() |
NewerOlder