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
snippet class | |
abbr class ... end | |
class ${1:#:ClassName} | |
${2:TARGET} | |
end | |
snippet defini | |
abbr def initialize(param) ... end | |
def initialize(${1:#:param}) | |
${2:TARGET} |
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/bin/awk | |
# Print current monitor resolution on WIDTHxHEIGHT style from xrandr | |
BEGIN { | |
FS = "," | |
} | |
{ | |
for (i = 1; i <= NF; i++) { | |
# find current monitor resolution | |
if ($i ~ /^ current/) { | |
str_current = $i |
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
# ls settings | |
alias ls="ls -F --color" | |
# completion with colors | |
zstyle ':completion:*' list-colors 'di=01;34' |
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
# ls colors | |
export LSCOLORS=ExFxxxxxBxxxxxxxxxxxxx | |
alias ls="ls -GF" | |
# completion with colors | |
zstyle ':completion:*' list-colors 'di=01;34:ln=01;35:ex=01;31' |
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
# test | |
これは github の android app から投稿しました。 |
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 |
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
<?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
<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_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 ? '...' : ''; |