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
{ | |
//... | |
// Alias local file path for browserify | |
// so that they can be callable by shorter name in browserify | |
// | |
"browser": { | |
// alias name: 'local path (related to where package.json is?)' | |
// |
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 if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. | |
the_post_thumbnail(); | |
} ?> | |
<!-- or --> | |
<?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. | |
$thumb = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'post-index') ); | |
} else { |
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
add_theme_support( 'post-thumbnails' ); | |
add_image_size('post-index', 300, 9999); |
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 | |
$big = 999999999; // need an unlikely integer | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $the_query->max_num_pages | |
) ); | |
?> |
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
$post_time = get_the_time('U'); | |
$today = time(); |
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 | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $wp_query->max_num_pages |
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
#git version 1.7.10.1 | |
git status | grep -e deleted | sed -e "s/# deleted: //g" | xargs git rm |
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
$telnet yahoo.co.jp 80 | |
>GET / HTTP/1.0 | |
>User-Agent: Telnet [ja] (Linux) | |
>Host: www.yahoo.co.jp | |
> | |
> |
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
import datetime | |
today = datetime.date.today() # 今日の日付けのdate型を作成 | |
# 任意の数値を変えたdateを返す | |
Year2013SameDay = today.replace(year=2013) | |
Month12SameDay = today.replace(month=12) | |
firstDay = today.replace(day=1) | |
# 0001年01月01日からの経過日数 |
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
from datetime import date | |
from calendar import monthrange | |
def get_last_date(year, month): | |
# monthrange は月の1日の曜日と日数を返してくれる | |
# 日数を date に渡せば月末の日付のできあがり | |
youbi, day = monthrange(year, month) | |
last = date(year, month, day) | |
return last |
OlderNewer