Skip to content

Instantly share code, notes, and snippets.

View yhirano55's full-sized avatar
🐕
Enjoy

yhirano55 yhirano55

🐕
Enjoy
View GitHub Profile
@yhirano55
yhirano55 / .env
Last active July 2, 2016 05:42
activeadminにおけるGoogle認証(omniauth-google-oauth2)導入手順 ref: http://qiita.com/yhirano55/items/35723893461717302940
GOOGLE_CLIENT_ID=**********YOUR_CLIENT_ID**********
GOOGLE_CLIENT_SECRET=**********GOOGLE_CLIENT_SECRET**********

Human.create.run

event current was
before_all_events sleeping sleeping
before_event sleeping sleeping
guards_event sleeping sleeping
guards_transition sleeping sleeping
before_exit_old_state sleeping sleeping
exit_old_state sleeping sleeping
@yhirano55
yhirano55 / anaconda.md
Created March 5, 2017 14:16
GolangでTwitterの検索結果を出力する

GolangでTwitterの検索結果を出力する

library

$ go get github.com/ChimeraCoder/anaconda

golangでJSONを扱う

encofing/jsonパッケージを利用する

JSONのUnmarshalize

package main

import (

目的

  • Dockerを管理するフレームワーク。Google製。
  • 船の舵をとる人、という意味

構成例

仕組みを知るうえで、欠かせない概念

Kubernetes Study

コマンド

# プロジェクト情報の確認
$ gcloud config list

# 予めセットすると設定しやすい
$ gcloud config set project PROJECT_ID
@yhirano55
yhirano55 / file0.rb
Last active December 7, 2017 08:06
関心事の分離とアンチパターン ref: https://qiita.com/yhirano55/items/92ba558bcb19f3a1f233
class Todo < ApplicationRecord
# Other todo implementation
# ...
## Event tracking
has_many :events
before_create :track_creation
after_destroy :track_deletion
@yhirano55
yhirano55 / main.rb
Last active February 17, 2018 03:20
Calculate robots sample
def calculate(n)
[1, 2, 3].repeated_combination(n).to_a.each_with_object({}) { |a, cache|
Array.new(n) do |i|
combination = a[0..i]
if combination.sum == n && !cache.key?(combination)
cache[combination] = true
end
end
}.keys
end
@yhirano55
yhirano55 / hangout.md
Created February 26, 2018 13:07
Google Hantoutでの登壇方法(画面共有方法)

Google Hangout での画面共有方法

当日、接続テストにて、サポートいたします。流れのみ、サラッとご確認ください。

  1. 公開用URLをクリック

    予めお伝えいただいたメールアドレスの受信箱をご確認ください。

  2. スピーカーをOFFにして、マイクとカメラをOFFにします。その後、ハングアウトオンエアに入室してください。

@yhirano55
yhirano55 / trello.rb
Created July 30, 2018 22:23
trello の json からカード名を抜き出すスクリプト
content = JSON.parse(File.read("./trello.json"))
content["actions"].select { |a| a["type"] == "createCard" && a.dig("data", "list", "name") == "Keep" }.map { |a| a.dig("data", "card", "name") }.each(&method(:puts))