⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
/** | |
* 指定サイズ以内の画像幅、高さを算出、 | |
* img要素にそのサイズを適用する | |
* | |
* 使い方: | |
* | |
* 例) 幅150px, 高さ200px以内で画像を表示する | |
* var img = document.createElement('img'); | |
* img.src = 'http://hoge.com/img/fuga.jpg'; | |
* imgResize.resize(img, 150, 200); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
/* | |
現在の日時から2日後のタイムスタンプを保存する | |
$d = 2 * 60 * 60 * 24; // 2日間 | |
$expire = current_time('timestamp', get_option("gmt_offset")) + $d; | |
update_post_meta($post->ID, '_expire', $expire); |