This file contains hidden or 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 | |
// TwitterOAuthライブラリ読み込み | |
require "twitteroauth/autoload.php"; | |
use Abraham\TwitterOAuth\TwitterOAuth; | |
// TwitterのAPIキー情報 | |
$consumerKey = "【コンシューマキー】"; | |
$consumerSecret = "【コンシューマシークレット】"; | |
$accessToken = "【アクセストークン】"; | |
$accessTokenSecret = "【アクセストークンシークレット】"; |
This file contains hidden or 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 | |
/* | |
Plugin Name: My Plugin | |
*/ | |
add_filter( 'the_content', 'my_add_content' ); | |
function my_add_content( $content ) { | |
$html = '<p>テストです。</p>'; | |
return $html . $content; |
This file contains hidden or 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
$ wp export --dir=/path/to/wpcalendar --post_type=post --post_status=publish |
This file contains hidden or 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
0 12 * * * /path/to/shell/update_wpcalendar.sh |
This file contains hidden or 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 | |
cd /path/to/wordpress | |
wp export --dir=/path/to/wpcalendar --post_type=post --post_status=publish | |
cd /path/to/wpcalendar | |
node wpxml2json.js dbname.wordpress.`date +%Y-%m-%d`.0.xml > wp.json |
This file contains hidden or 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
//data.item.push({title:item.title, url:item.link, date:item["wp:post_date"]["#"]}); | |
if (item["wp:post_type"]["#"] == 'post') { | |
data.item.push({title:item.title, url:item.link, date:item["wp:post_date"]["#"]}); | |
} |
This file contains hidden or 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
// 「/date」は付かないので無くす | |
// window.open(blogURL+'/date/'+d.replace(/-/g,'/')); | |
window.open(blogURL+'/'+d.replace(/-/g,'/')); |
This file contains hidden or 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
品質80%で圧縮 | |
$ jpegoptim --max=80 image.jpg | |
画像のメタ情報を全て削除し、品質50%で圧縮 | |
$ jpegoptim --strip-all --max=50 image.jpg | |
ディレクトリ内の全てのjpg画像を圧縮 | |
$ jpegoptim --max=80 *.jpg | |
保存先ディレクトリを指定して圧縮 |
This file contains hidden or 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
jpegoptimインストール | |
$ wget http://www.kokkonen.net/tjko/src/jpegoptim-1.4.2.tar.gz | |
$ tar -zxvf jpegoptim-1.4.2.tar.gz | |
$ cd jpegoptim-1.4.2 | |
$ ./configure | |
$ make | |
$ sudo make install | |
インストール確認 | |
$ jpegoptim --version |
This file contains hidden or 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
ALTER TABLE `dtb_session` CHANGE `sess_data` `sess_data` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; | |
ALTER TABLE `dtb_order_temp` CHANGE `session` `session` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; |