Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
@trepmal
trepmal / editor_plugin.js
Created October 3, 2011 23:17
WordPress: TinyMCE button that wraps selection in given tag
// http://tinymce.moxiecode.com/wiki.php/API3:class.tinymce.Plugin
(function() {
tinymce.create('tinymce.plugins.WRAP', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished its initialization so use the onInit event
* of the editor instance to intercept that event.
*
@miya0001
miya0001 / class-addpage.php
Created March 3, 2012 13:27
WordPressに独自のページを表示する
<?php
if (!class_exists('WP_AddPage')):
class WP_AddPage {
private $rule = null;
private $title = null;
private $callback = null;
private $template = null;
private $filter = false;
@miya0001
miya0001 / gist:2037109
Created March 14, 2012 15:09
WordPressで好き勝手なコンテンツを好き勝手なURLで表示する
<?php
/*
Plugin Name: I am Free!
Author: My Name
Description: WordPressで好き勝手なコンテンツを好き勝手なURLで表示する。
*/
require_once(dirname(__FILE__).'/includes/class-addrewriterules.php');
require_once(dirname(__FILE__).'/includes/class-addpage.php');
@miya0001
miya0001 / gist:3854254
Created October 8, 2012 19:00
アイキャッチ画像を記事内の好きな場所に挿入するためのショートコード
<?php
function post_thumbnail_shortcode($p) {
$id = 0;
if (isset($p[0]) && $p[0]) {
$id = url_to_postid($p[0]);
}
if (!intval($id)) {
$id = get_the_ID();
}
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@miya0001
miya0001 / gist:3988074
Created October 31, 2012 16:29
のぼりんに教えてもらった.bash_historyからコマンドの使用回数ベストテン
cut -d ' ' -f1 ~/.bash_history | sort | uniq -c | sort -r | head -n 10
@maepon
maepon / query_plugin_authoring_ja.md
Created February 11, 2013 12:38
プラグイン作成

プラグイン/作成

jQueryを使うことが快適になってきたら、プラグインの作り方を知りたくなるでしょう。それは正解です!プラグインとメソッドでjQueryを利用することは、非常に協力で、さらに、プラグインの中に最も有効な機能を抽象化することで、開発にかける時間を大幅に節約出来ます。この記事は、プラグインを書き始める際の基本的な概要とベストプラクティス、さらに気をつける必要のある一般的な落とし穴についての記事です。

目次

  1. さあはじめよう
  2. コンテキスト
@gregrickaby
gregrickaby / html5-schema.org-markup.html
Last active August 2, 2022 00:05
Proper SCHEMA.ORG markup
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
@geckotang
geckotang / memo.markdown
Last active December 21, 2015 16:18
grunt + styledocco + scss (compass)
@miya0001
miya0001 / gist:6668263
Last active October 9, 2017 05:19
WordPressコアに対するパッチの作り方
========
パッチの作り方
========
$ mkdir wordpress
$ cd wordpress # ここがドキュメントルート
$ svn co http://develop.svn.wordpress.org/trunk/ .
$ svn update # 作業を行う直前に毎回実行!
ファイルを追加した場合は `svn add` でそのファイルを追加する。