Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryo Nakamura r7kamura

View GitHub Profile
@r7kamura
r7kamura / gcloud_oidc_setup.sh
Last active May 12, 2022
Create a GCP project and some resources for OIDC.
View gcloud_oidc_setup.sh
#!/bin/bash
set -eu
set -o pipefail
# Set these 2 variables.
PROJECT_ID="godolog-example-15" # e.g. godolog-example
GITHUB_REPO="r7kamura/godolog-example" # e.g. r7kamura/godolog-example
SERVICE_ACCOUNT_ID="google-drive-reader"
SERVICE_ACCOUNT_EMAIL="${SERVICE_ACCOUNT_ID}@${PROJECT_ID}.iam.gserviceaccount.com"
@r7kamura
r7kamura / obs-script-example.lua
Last active May 10, 2022
An example script for OBS written in Lua.
View obs-script-example.lua
obs = obslua
source_name = ""
function on_second_tick()
update_text()
switch_to_preferred_scene()
end
function calculate_timer_text()
@r7kamura
r7kamura / Redirector.json
Created May 5, 2022
Example Redirector settings to redirect JA to EN on docs.github.com.
View Redirector.json
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2022-05-05T22:35:21.668Z",
"redirects": [
{
"description": "GitHub Docs ja to en",
"exampleUrl": "https://docs.github.com/ja/repositories/creating-and-managing-repositories/creating-a-template-repository",
"exampleResult": "https://docs.github.com/en//repositories/creating-and-managing-repositories/creating-a-template-repository",
"error": null,
"includePattern": "https://docs.github.com/ja($|/.*)",
View 複数の役職に分割できる可能性のあるアニメスタッフの役職の表記一覧.txt
2Dデザイン・特殊効果
2Dワークス・特殊効果
2D・モニターデザイン
2D・特殊効果
3Dディレクター・モデリング
3Dディレクター・モデルデザイン
3Dメカニックデザイン・3D監修
3Dヴィジュアル・ディレクター
3D・CG制作・モニターグラフィックス
CAD・メカニックデザイン
@r7kamura
r7kamura / README.md
Last active Mar 19, 2021
Migration from Sprockets to Webpack
View README.md

Directory structure

Before

.
|-- app/
|   `-- assets/
|       |-- fonts/
| |-- images/
@r7kamura
r7kamura / get_json_then_convert_it_to_xml.rb
Last active Nov 24, 2020
Ruby script to GET JSON then convert it to XML.
View get_json_then_convert_it_to_xml.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
gem 'builder'
gem 'faraday'
gem 'faraday_middleware'
end
@r7kamura
r7kamura / convert_json_to_xml.rb
Last active Nov 23, 2020
Ruby script to convert JSON to XML.
View convert_json_to_xml.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
gem 'builder'
end
require 'active_support/core_ext/array/conversions'
View install-rbenv.md

Install rbenv on Mac OS X

homebrewで依存ライブラリを入れた後、homebrewでrbenvとruby-buildを入れる。

Requirements

rbenvとruby-buildを入れるために、以下のライブラリが必要。 過去に既に古いバージョンのものが入っていた場合は、brew linkしたり、brew link --forceする必要があるかもしれない。 自分の場合は、opensslとreadlineがそうだった。

  • libyaml
  • openssl
@r7kamura
r7kamura / factory_bot_factories_spec.rb
Last active Nov 13, 2020
Example to lint FactoryBot factories with RSpec.
View factory_bot_factories_spec.rb
require 'rails_helper'
RSpec.describe 'FactoryBot factory' do
FactoryBot.factories.each do |factory|
describe factory.name.inspect do
it 'creates valid record' do
expect { FactoryBot::Linter.new([factory]).lint! }.not_to raise_error
end
end
end
View active_record_bidirectional_accepts_nested_for_test.rb
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activerecord', '6.0.3.4'
gem 'sqlite3'
end