Skip to content

Instantly share code, notes, and snippets.

View AKB428's full-sized avatar
🥳
Out sick

AKB428 AKB428

🥳
Out sick
View GitHub Profile
@AKB428
AKB428 / readable_code.md
Last active February 10, 2024 08:10
リーダブルコード要約/Digest 「The Art of Readable Code」

リーダブルコード読書会及び要約共有会の目的

  • 今後コードレビュー時に「これってリーダブルコードの◯◯だよね?、こう直したほうがいいよね」と引用できレビューの時間の短縮化が実現できる。
  • リーダブルコードに登場する特殊ワードをチームのコーディングの共通語とする。デザインパターンのカタログ的な考え。
  • リーダブルコードを読んでない人も内容を短時間で把握できる。
  • チーム全体のコードを読みやすくメンテナンスしやすくし品質をあげる。
  • リーダブルコード教になりチーム以外にも広める。コードの品質が悪い人にはリーダブルコードの読書を進めてみる。ひどいコードのままコーディングしてもらうよりその時間を読書の時間に割り当てることも考える(結果的に時間が還元できるなら)。
  • リーダブルコードに書いてあることが全てのプロジェクトに適用てきるわけではないけれでもコーディングルールを考える際の指針にすることはできる。

対象者

@AKB428
AKB428 / readable_code_checklist.md
Last active February 22, 2022 08:11
リーダブルコード適用 チェックリスト

#リーダブルコード適用 チェックリスト

リーダブルコード適用 チェックリスト使い方

  • コーディング初心者はコードを書いた後、コードレビューしてもらう前にこのチェックリストでセルフチェックをする
  • (コーディング中級者の)レビューワーはこのチェックリストをチェックつけながらコードレビューをする
  • コーディング上級者(もしくはリーダブルコードを暗記してる人)はこのチェックリストは必要ないが、プロジェクトのレビュー運営のポリシーによって使うこともある。
  • チェックリストの内容がわからなかった場合はリーダブルコード要約、もしくは「リーダブルコード」自体を読んで確認する。
  • 今すぐ直せないコードもあるため全てにチェックがつかないといけないわけじゃない、チェックできなかった理由をレビュー対象者と共有し議論し、改善できる点は今後に活かそう。
  • チェックにひっかかった、悪いコードはアンチパターン集としてプロジェクトの大事な資産としてwikiなどに記録して勉強会などで紹介してみよう。
@AKB428
AKB428 / iftop_osx_insrall
Last active March 4, 2018 08:33
iftopをOSXにbrewでイントール
Siori@Siori-no-MacBook-Air:~/code/git_akb428/chino (master)$ brew install iftop
==> Downloading http://www.ex-parrot.com/pdw/iftop/download/iftop-1.0pre4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/iftop/1.0pre4 --mandir=/usr/local/Cellar/iftop/1.0pre4/share/man
==> make install
==> Caveats
iftop requires superuser privileges. You can either run the program
via `sudo`, or change its ownership to root and set the setuid bit:
$ sudo chown root:wheel /usr/local/Cellar/iftop/1.0pre4/sbin/iftop
$ sudo chmod u+s /usr/local/Cellar/iftop/1.0pre4/sbin/iftop
@AKB428
AKB428 / twVideo.json
Created February 7, 2015 18:31
Twitter Video JSON
{
"contributors": null,
"text": "ツイッター動画投稿テスト http://t.co/y9hjEfABw1",
"geo": null,
"retweeted": false,
"in_reply_to_screen_name": null,
"possibly_sensitive": false,
"truncated": false,
"lang": "ja",
"entities": {
@AKB428
AKB428 / mikasa_install.md
Last active March 10, 2016 16:08
Mikasaインストールマニュアル

以下はLinuxインスタンスを生成したばかりのVPSまたはクラウドOSにMikasaをインストールする場合について記述している。

OSはCentOS7を対象にして説明している。

Java、Rubyのインストール手順はインストール済みの場合はSKIPして問題ないがJava7+、Ruby2.0+がインストールされていること。

用意するもの

  • Twitterの開発者アカウント
  • Amazonの開発者アカウント(つぶやきデータから商品をレコメンドする場合)
@AKB428
AKB428 / Gemfile
Last active November 9, 2015 16:33
放映中のアニメ公式 Twitterアカウントのフォロワー変動履歴情報を提供するRESTful API サーバーを作りました ref: http://qiita.com/AKB428/items/c12c70b16c924a45f73f
# A sample Gemfile
source "https://rubygems.org"
gem 'shangrila'
@AKB428
AKB428 / file0.sql
Last active November 8, 2015 17:18
MySQL と MariaDBの プリペアドステートメント バインドパラメーターがSQL関数だった時の挙動の違い ref: http://qiita.com/AKB428/items/8be7059e7e2919cea090
SELECT h.follower, h.updated_at
from twitter_status_histories as h,
(SELECT id FROM bases WHERE twitter_account = 'usagi_anime' order by id desc limit 1) b
where h.bases_id = b.id AND h.updated_at < ? order by h.updated_at desc limit 100
@AKB428
AKB428 / file0.txt
Last active November 8, 2015 16:08
放映中のアニメ作品の情報を提供するAnime RESTful API サーバー作りました ref: http://qiita.com/AKB428/items/64938febfd4dcf6ea698
$curl http://api.moemoe.tokyo/anime/v1/master/cours | jq .
{
"4": {
"id": 4,
"year": 2014,
"cours": 4
},
"5": {
"id": 5,
@AKB428
AKB428 / file0.txt
Created November 3, 2015 18:36
ElixirでMySQLのdatetime型をUNIX TIMESTAMPに変換する ref: http://qiita.com/AKB428/items/1e6491b4badcf416d9be
defmodule UnixTime do
def convert_date_to_unixtime(created_at) do
#JSTの場合9Hにしておく
epoch = {{1970, 1, 1}, {9, 0, 0}}
epoch_gs = :calendar.datetime_to_gregorian_seconds(epoch)
{{year, month, day}, {hour, minute, second, msec}} = created_at
gs = :calendar.datetime_to_gregorian_seconds({{year, month, day}, {hour, minute, second}})
gs - epoch_gs
end
@AKB428
AKB428 / quote_future.csv
Last active September 17, 2015 10:05
Azure Machine Learning を使った為替レートを元にした日経平均株価予想 ref: http://qiita.com/AKB428/items/8944b0b000d89b2d058c
USD 日経株価
2015/9/17 120.539 0
2015/9/18 120.539 0