IAMユーザーを持っていないメンバーや外部の人間とS3バケット上のオブジェクトをやり取りする際はStorage Browser for S3も検討しよう
https://dev.classmethod.jp/articles/storage-browser-for-s3-amplify/
ちょっと気になるのでメモメモ
IAMユーザーを持っていないメンバーや外部の人間とS3バケット上のオブジェクトをやり取りする際はStorage Browser for S3も検討しよう
https://dev.classmethod.jp/articles/storage-browser-for-s3-amplify/
ちょっと気になるのでメモメモ
リアクションボタンを追加できた。
スニペットのプラグインを入れて下記の通り対応。
add_filter('the_content','simple_reactions');
add_filter('the_excerpt','simple_reactions');
function simple_reactions($content){
if(is_admin()) return $content;
global $post;
$reactions = [
'like' => '👍 want you',
'love' => '❤️ lover men',
'read' => '👀 Cleanup Clean Lady'
];
$buttons = '<div class="simple-reactions">';
foreach($reactions as $key => $emoji){
$count = (int)get_post_meta($post->ID,'reaction_'.$key,true);
$buttons .= '
<button class="simple-reaction-btn"
data-post="'.$post->ID.'"
data-reaction="'.$key.'"
data-label="'.$emoji.'">
'.$emoji.' '.$count.'
</button>';
}
$buttons .= '</div>';
return $content.$buttons;
}
add_action('wp_footer','simple_reactions_script');
function simple_reactions_script(){ ?>
<script>
document.addEventListener('click', async function(e){
if(!e.target.classList.contains('simple-reaction-btn')) return;
const btn = e.target;
const label = btn.dataset.label;
const form = new FormData();
form.append('action','simple_reaction');
form.append('post_id',btn.dataset.post);
form.append('reaction',btn.dataset.reaction);
const res = await fetch('<?php echo admin_url('admin-ajax.php'); ?>',{
method:'POST',
body:form
});
const count = await res.text();
btn.innerHTML = label + ' ' + count;
});
</script>
<?php }
add_action('wp_ajax_simple_reaction','simple_reaction');
add_action('wp_ajax_nopriv_simple_reaction','simple_reaction');
function simple_reaction(){
$post_id = (int)$_POST['post_id'];
$reaction = sanitize_text_field($_POST['reaction']);
$meta_key = 'reaction_'.$reaction;
$count = (int)get_post_meta($post_id,$meta_key,true);
$count++;
update_post_meta($post_id,$meta_key,$count);
echo $count;
wp_die();
}
「外観 → カスタマイズ → 追加CSS」
.simple-reactions{
display:flex;
gap:10px;
margin-top:8px;
flex-wrap:wrap;
}
.simple-reaction-btn{
background:none;
border:none;
padding:0;
cursor:pointer;
font-size:11px;
line-height:1.2;
color:#888 !important;
opacity:0.85;
}
.simple-reaction-btn:hover{
opacity:1;
}
そんでこれが公開版。
こんな昔からの時系列で出されてもおっさんしか面白くないと思うけど、酒の肴にでもしておくれ
Pythonで動くグラフの練習。
って言ってもほぼライブラリ使うだけだから、Python便利~~!以上の感想はない。すごい便利~~!!!
デジモンゲーム売上TOP15 ※作成途中※
何がどんくらい売れたのか情報がないのに作ろうとするからこうなる…!
・販売本数/出荷本数、日本/世界と厳密な調査はできていません
・不明なものは2万本で固定、DSは10万本で固定
なので情報募集中!
まだ限定公開にしてるんだけど、もう少し情報埋められたら公開設定切り替えよ。
ファミ通のバックナンバーでも漁ったら昔のソフトの出荷本数の目安わかったりするんかな。
基本的なウェブアプリケーションを構築する
https://aws.amazon.com/jp/getting-started/hands-on/build-web-app-s3-lambda-api-gateway-dynamodb/
今度は躓かないようにこちらのブログも参考に!
2024年版「基本的なウェブアプリケーションを構築する」のチュートリアル手順まとめてみた[Amplify Gen2対応]
https://dev.classmethod.jp/articles/2024-build-web-app-s3-lambda-api-gateway-dynamodb/
よかったー。とりあえず完走。参考にしたサイトないとちょっと危ない。
基本的なウェブアプリケーションを構築する
https://aws.amazon.com/jp/getting-started/hands-on/build-web-app-s3-lambda-api-gateway-dynamodb/
別のチュートリアルに手を出す。
今度は躓かないようにこちらのブログも参考に!
2024年版「基本的なウェブアプリケーションを構築する」のチュートリアル手順まとめてみた[Amplify Gen2対応]
https://dev.classmethod.jp/articles/2024-build-web-app-s3-lambda-api-gateway-dynamodb/
チュートリアルの手順1~6のうち、3まで終了!
AWSのチュートリアルは検索してみるとバージョンアップに追いついてなくてどうしても進めなくなることがままあるみたい。
ちょっとほかのAmplifyのチュートリアルやろう。
PC新しくしたので AWS Amplify のチュートリアルとセットアップとかもやる。(4)
フルスタック React アプリケーションを構築する
https://aws.amazon.com/jp/getting-started/hands-on/build-react-app-amplify-graphql/
これにより、Amplify コンソールが開きます。ナビゲーションペインから [App settings] (アプリの設定) > [Build settings] (ビルドの設定) を選択し、
その項目が見当たらない…!続きはまたにしよう。
PC新しくしたので AWS Amplify のチュートリアルとセットアップとかもやる。(3)
フルスタック React アプリケーションを構築する
https://aws.amazon.com/jp/getting-started/hands-on/build-react-app-amplify-graphql/
Amplify Studio のバックエンドの選択が見つからなくて、検索で直接ページを見つけたんだけど手順あってるのかこれ。もう非推奨の手順だったりしないだろうな。
「ローカル Amplify アプリを初期化する」のステップ終わり。
次のステップの
> これらのリソースを使用してアプリを設定するには、src/index.js を開き、最後のインポートの下に次のコードを追加します。
の手順まではコピペですぐ終わったので進行中!
PC新しくしたので AWS Amplify のチュートリアルとセットアップとかもやる。(2)
フルスタック React アプリケーションを構築する
https://aws.amazon.com/jp/getting-started/hands-on/build-react-app-amplify-graphql/
Amplify と連携できたけど、コマンドからのコミットでエラーが出る。どうも認証用のファイルを配置しておくみたい。後で調べるとして、ほかのツール使ってコミットすれば次の手順には進めるので、とりあえずどんどん進めてみる。
「REACT アプリケーションをデプロイおよびホストする」のステップ終わり。