Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
@hissy
hissy / rscsvimporter-debug.php
Last active April 6, 2020 03:24
Really Simple CSV Importer Debugger add-on
<?php
/*
Plugin Name: Really Simple CSV Importer Debugger add-on
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard.
Author: Takuro Hishikawa
Version: 0.2
*/
class rscsvimporter_debug {
// singleton instance
@gatespace
gatespace / gist:7147747
Last active January 22, 2016 19:33
[WordPress] デフォルトのアーカイブウィジェットを特定のカスタム投稿タイプの時のみその投稿タイプのアーカイブにする。要「Custom Post Type Permalinks」プラグイン。
/**
* ウィジェット「アーカイブ」にフィルター
* require Custom Post Type Permalinks
*/
add_filter( 'widget_archives_args', 'my_widget_archives_args', 10, 1);
add_filter( 'widget_archives_dropdown_args', 'my_widget_archives_args', 10, 1);
function my_widget_archives_args( $args ){
if ( ! is_admin() ) {
if ( 'blog' == get_post_type() ) {
@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` でそのファイルを追加する。
@geckotang
geckotang / memo.markdown
Last active December 21, 2015 16:18
grunt + styledocco + scss (compass)
@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" />
@maepon
maepon / query_plugin_authoring_ja.md
Created February 11, 2013 12:38
プラグイン作成

プラグイン/作成

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

目次

  1. さあはじめよう
  2. コンテキスト
@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
@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@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();
}
@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');