Skip to content

Instantly share code, notes, and snippets.

Hitoshi Hayakawa hykw

Block or report user

Report or block hykw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hykw
hykw / gist:2051d82ef2ec76869e03
Last active Aug 29, 2015
svnのcopy, merge, switch方法
View gist:2051d82ef2ec76869e03
svn copy trunk branches/hogehoge
svn commit
→ リビジョン12345とする
# 〜〜〜 branchで作業、最終リビジョンは22222
# BASEディレクトリにcd(svn mergeはパスを指定しないと作業ディレクトリを対象にしちゃうので)
cd ~/svn/hogeSVN
# 12345〜22222(≒ HEAD)の修正を trunk にマージ
@hykw
hykw / gist:1c086f031b28fd942455
Created Sep 12, 2014
telnet のかわりに openssl で接続
View gist:1c086f031b28fd942455
openssl s_client -connect example.jp:443 -quiet
View gist:cccc8790fbb252ec7357
openssl s_client -connect ssl.example.com:443
というか、telnet-ssl 入れて
telnet-ssl -z ssl ssl.example.com 443
View gist:65fb50edf11edf1cd9bc
$nonce = wp_nonce_field('pagename', '_wpnonce', true, false);
<form>
{$nonce}
</form>
---------------------
if(is_page('pagename') && isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'pagename')) {
#
} else {
@hykw
hykw / gist:bb0a1d034b648c275643
Last active Aug 29, 2015
MySQL: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
View gist:bb0a1d034b648c275643
/etc/my.cnf
-------------------------
default-character-set=utf8
character-set-server = utf8
collation-server=utf8_general_ci
init_connect='SET collation_database = utf8_general_ci; SET collation_connection = utf8_general_ci'
skip-character-set-client-handshake
-------------------------
mysql> ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci
@hykw
hykw / gist:3e43d3e62d34bb7e718e
Created Jul 18, 2014
wordpress: 投稿画面の項目非表示
View gist:3e43d3e62d34bb7e718e
function remove_default_post_screen_metaboxes() {
remove_meta_box( 'tagsdiv-post_tag' , 'post' , 'side' ); /* 投稿のタグ */
}
add_action('admin_menu','remove_default_post_screen_metaboxes');
@hykw
hykw / gist:27f9586f2e9af88afe56
Created Jul 18, 2014
wordpress: 投稿画面に注記を追加
View gist:27f9586f2e9af88afe56
function after_title() {
echo '<p>これはタイトル下に表示される</p>';
}
add_action( 'edit_form_after_title', 'after_title' );
function after_editor() {
echo '<p>これはエディタ下に表示される</p>';
}
add_action( 'edit_form_after_editor', 'after_editor' );
@hykw
hykw / gist:f62244c4fe1924ecfd6d
Last active Aug 29, 2015
wordpress: 固定ページでページング
View gist:f62244c4fe1924ecfd6d
■コンテンツ側
<!--nextpage-->
■php側
<?php
# ページングタグを表示する所で設定
wp_link_pages();
--------
c.f.
@hykw
hykw / gist:a78d1a28155d47768986
Last active May 24, 2016
wordpress: WP_Query() 呼び出し例
View gist:a78d1a28155d47768986
$args = array(
'post_type' => array(
'post',
),
'post_status' => array(
'publish',
),
'posts_per_page' => 5,
'order' => 'DESC',
'orderby' => 'date',
You can’t perform that action at this time.