Skip to content

Instantly share code, notes, and snippets.

View dwesolowski's full-sized avatar

Daren Wesolowski dwesolowski

View GitHub Profile
@dwesolowski
dwesolowski / YamlConfig.java
Last active December 3, 2020 19:27
Multi file config class for Spigot / Bukkit plugins
package com.github.dwesolowski.testing;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.io.IOException;
/** Add word count to excerpts */
function excerpt_count_js() {
if ('page' != get_post_type()) {
?>
<style>.span-excerpt_counter{font-size:12px;font-weight:normal;float:right;}</style>
<?php
echo '<script>jQuery(document).ready(function($) {
$("#postexcerpt .hndle").append("<span class=\"span-excerpt_counter\">Excerpt length: <span id=\"excerpt_counter\"></span><span> / 10 </span><span>character(s).</span></span>");
$("span#excerpt_counter").text($("#excerpt").val().length);
$("#excerpt").keyup( function() {
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
add_action( 'admin_head', function(){
ob_start();
?>
<style>
#your-profile > h2,
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap
/*.user-comment-shortcuts-wrap,*/