This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show exec environment | |
__show_env() { | |
if [ `pwd | grep "^/var/www/prod" | wc -l` -eq 1 ];then | |
echo "(prod)" | |
elif [ `pwd | grep "^/var/www/test" | wc -l` -eq 1 ];then | |
echo "(test)" | |
elif [ `pwd | grep "^/var/www/dev" | wc -l` -eq 1 ];then | |
echo "(dev)" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lang | |
export LANG=ja_JP.UTF-8 | |
# prompt | |
autoload colors | |
colors | |
PROMPT="%{${fg[green]}%}%/ | |
[%n]%%%{${reset_color}%} " | |
PROMPT2="%{${fg[green]}%}%_>%{${reset_color}%} " | |
SPROMPT="%B%{${fg[green]}%}%r is correct? [n,y,a,e]:%{${reset_color}%}%b " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"============================ | |
" neobundle.vim {{{ | |
"============================ | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
call neobundle#begin(expand('~/.vim/bundle/')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 新規ユーザー作成時に管理バーを表示しない設定にする(WP3.1.4で確認) | |
function my_nodisplay_adminbarfront( $user_id ) { | |
update_user_meta( $user_id, 'show_admin_bar_front', 'false' ); | |
} | |
add_action( 'user_register', 'my_nodisplay_adminbarfront' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#====================================== | |
# default config | |
#====================================== | |
# default shell | |
set-option -g default-shell /bin/zsh | |
# available pbpaste/pbcopy (Require install ChrisJhonsen/tmux-MacOSX-pasteboard) | |
#set-option -g default-command "reattach-to-user-namespace -l zsh" | |
# vi key binding at copy mode | |
set -g mode-keys vi | |
# mouse mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_blog_description() { | |
$description = ''; | |
if ( is_single() ) { | |
// 投稿の場合 | |
$_post = get_post(); | |
$description = $_post->post_content; | |
$description = preg_replace( "/[\n|\r|\n\r|\t|\s]/", '', $description ); | |
$description = strip_tags( $description ); | |
$more_str = mb_strlen( $description, 'UTF-8' ) > 100 ? '...' : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>" class="hatena-bookmark-button" data-hatena-bookmark-title="<?php echo the_title_attribute( array( 'echo' => 0 ) ) . ' | ' . get_bloginfo( 'name' ); ?>" data-hatena-bookmark-layout="vertical" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに>追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_hatena_star_code() { | |
?> | |
<script type="text/javascript" src="http://s.hatena.ne.jp/js/HatenaStar.js"></script> | |
<script type="text/javascript"> | |
Hatena.Star.SiteConfig = { | |
entryNodes: { | |
'article': { | |
uri: 'h1 a', | |
title: 'h1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
# ruby numerals.rb 1234 | |
# => twelve hundred thirty-four | |
class Num2Eng | |
# 数字と英語を結びつける | |
NUM_ENG = {'0' => 'zero', | |
'1' => 'one', | |
'2' => 'two', | |
'3' => 'three', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -s https://getcomposer.org/installer | php |
OlderNewer