Skip to content

Instantly share code, notes, and snippets.

View juno's full-sized avatar
💰
writing code (almost) every weekday

Junya Ogura juno

💰
writing code (almost) every weekday
View GitHub Profile
@juno
juno / 📊 Weekly development breakdown
Last active May 13, 2026 00:41
📊 Weekly development breakdown
Markdown 1 hr 23 mins ███████▍░░░░░░░░░░░░░ 35.6%
JSON 55 mins ████▉░░░░░░░░░░░░░░░░ 23.7%
Other 28 mins ██▌░░░░░░░░░░░░░░░░░░ 12.4%
YAML 25 mins ██▎░░░░░░░░░░░░░░░░░░ 10.9%
TypeScript 12 mins █▏░░░░░░░░░░░░░░░░░░░ 5.4%
@juno
juno / script.sh
Last active April 11, 2026 02:21
Hatchbox.io Post Deploy Script for New Relic Releases
# --- Configuration ---
# If these are defined in Hatchbox Environment Variables, keep the variable names as is.
# Otherwise, replace them with your actual strings (e.g., "NRAK-...").
NR_API_KEY="${NEW_RELIC_API_KEY}"
NR_ENTITY_GUID="${NEW_RELIC_ENTITY_GUID}"
# 1. Get version information (Use REVISION file if available, otherwise use timestamp)
DEPLOY_VERSION=$(cat REVISION 2>/dev/null || date +%Y%m%d-%H%M%S)
# 2. Build GraphQL query
@juno
juno / stack.md
Created April 8, 2026 07:33
My web app stack

My web app stack

Backend

  • Ruby on Rails
  • PostgreSQL (public app), SQLite (in-house app)
  • authentication_zero for User authentication

Deployment

@juno
juno / my-favorite-nice-small-companies.md
Last active February 1, 2026 09:24
My favorite ( small business | profitable | bootstrapped ) companies. 💕
  • Basecamp
    • Founded: 1999
    • Location: Chicago and remote
    • Team: ~50
    • Customers: Over 100,000 companies
    • Wikipedia
  • DNSimple Corporation (prev. Aetrion LLC.)
    • Founded: 2010
    • Team: 12
  • Product: DNSimple
@juno
juno / README.md
Last active June 22, 2025 04:37
claude-code-github-remote-mcp.md

Prerequisite

  • GitHub Personal Access Token with repository access permissions

Add GitHub Remote MCP server to Claude Code

  • Set your token in the Authorization header
  • The MCP server name should be "github"
@juno
juno / zsh-git-completion-setting.md
Created May 9, 2013 08:09
zshでgitの補完を設定する手順。

gitのソースツリーに含まれるgit-completion.zshをzshで使う手順

注意:gitコマンドがhubコマンドへのエイリアスに設定されている場合は補完が働かない。

補完用ファイルを置くディレクトリを作成する(既に同じ用途のディレクトリがある場合はそれを使う)。

$ mkdir ~/.zsh/completion/
@juno
juno / rails-association-validation-strategy.md
Created November 16, 2014 17:48
ActiveRecordモデルにおけるAssociationのバリデーション戦略

ActiveRecordモデルにおけるAssociationのバリデーション戦略

  • foo_idのpresenceでは、存在しないIDでも保存できてしまう
    • fooを参照した際はnilが返る
  • fooのpresenceを指定すると、foo_idへの代入ではバリデーションを通らなくなる
    • fooに未保存のオブジェクトを代入してsave!するとPG::NotNullViolationが発生する
      • PG::NotNullViolation: ERROR: null value in column "character_id" violates not-null constraint
  • Polymorphic association
    • validates :foo_type, presence: trueは不要
  • クラスが存在しない場合はsave!時にNameError: uninitialized constant XXXが発生する
@juno
juno / ec2_start_instances.js
Last active April 17, 2024 12:23
AWS Lambda Function to call EC2 StartInstances/StopInstances API
/* Event Parameters
{
"accessKeyId": "...",
"secretAccessKey": "...",
"region": "ap-northeast-1",
"instanceId": "i-XXXXXXXX"
}
*/
exports.handler = function(event, context) {
console.log('instanceId =', event.instanceId);
@juno
juno / README.md
Created November 1, 2011 08:40
Install rbenv and ruby-build to Amazon Linux (cloud-init).

Install rbenv and ruby-build to Amazon Linux (cloud-init).

  1. Copy & paste content of user-data.sh to EC2 RunInstances user-data
  2. Then, logging in to EC2 instance as ec2-user and run install-ruby.sh.