Skip to content

Instantly share code, notes, and snippets.

@akahigeg
akahigeg / post_title.html(in post_guide directory)
Created June 3, 2018 05:24
Help file for WordPress post guide.
<h3>タイトル <span style="color: red; font-size: 9pt;">必須項目</span></h3>
<p>記事のタイトル。</p>
<p>全角28文字以内になることを想定にサイトのデザインは作成されている。</p>
<h4>表示される場所</h4>
<h5>トップページ</h5>
画像入れたりとか
<h5>記事の一覧</h5>
ごにょごにょ
<h5>カテゴリーの一覧</h5>
@akahigeg
akahigeg / functions.php
Last active June 3, 2018 05:00
functions.php for WordPress post guide.
<?php
// 管理画面にCSSとJSの読み込みを追加
function enqueue_post_guide_files() {
wp_enqueue_style('post-guide-style' , get_stylesheet_directory_uri() . '/css/post_guide.css');
wp_enqueue_script('post-guide-js' , get_stylesheet_directory_uri() . '/js/post_guide.js');
}
add_action('admin_enqueue_scripts', 'enqueue_post_guide_files');
// 指定されたpost_idの投稿の投稿タイプを返す
function ajax_post_type_by_post_id() {
@akahigeg
akahigeg / post_guide.js
Last active June 3, 2018 05:22
JavaScript file for WordPress post guide.
jQuery(document).ready(function () {
// 投稿の新規追加もしくは編集画面以外では表示しない
if (location.pathname != '/wp-admin/post-new.php' && location.pathname != '/wp-admin/post.php') {
return;
}
// 投稿ガイドの表示
initPostGuide();
});
@akahigeg
akahigeg / post_guide.css
Last active June 3, 2018 05:30
CSS for WordPress post guide.
ul.post-guide-panel {
position: fixed;
table-layout: fixed;
top: 30;
width: 100%;
z-index: 88888;
}
ul.post-guide-panel li {
position: relative;
@akahigeg
akahigeg / functions.php
Last active June 1, 2018 01:43
wordpress-admin-modal
<?php
// 管理画面にCSSとJSの読み込みを追加
function enqueue_modal_files() {
wp_enqueue_style('modal-style' , get_stylesheet_directory_uri() . '/css/modal.css');
wp_enqueue_script('modal-js' , get_stylesheet_directory_uri() . '/js/modal.js');
}
add_action('admin_enqueue_scripts', 'enqueue_modal_files');
// AJAXリクエストに対してJSONを返す
function ajax_modal() {
#!/bin/bash
# Download dcpTool
# https://sourceforge.net/projects/dcptool/files/latest/download
# 作業フォルダを作成してその中に移動
cd ~
mkdir setup-k-1-mk2-profile-tmp
cd setup-k-1-mk2-profile-tmp
#
# Cookbook Name:: sensu-mailer-sample
# Recipe:: default
#
sensu_gem "mail"
mailer_rb_path = "#{node.sensu.directory}/handlers/mailer.rb"
cookbook_file mailer_rb_path do
source "mailer.rb"
@akahigeg
akahigeg / thread_value_store.rb
Created July 22, 2013 13:54
use this instead of class valuables for thread safe.
# -*- encoding : utf-8 -*-
#
# for thread safe
#
class ThreadValueStore
@@value_store = {}
@@store_types = {}
def self.reserve(name, store_type = :value)
@akahigeg
akahigeg / hoge.rb
Created June 21, 2013 04:25
テスト
p "HOGE!"