Skip to content

Instantly share code, notes, and snippets.

View MH4GF's full-sized avatar
🐇

Hirotaka Miyagi MH4GF

🐇
View GitHub Profile
@mislav
mislav / config.json
Last active January 18, 2024 10:48
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry
// ~/docker/config.json
{
"credsStore": "desktop",
"credHelpers": {
"docker.pkg.github.com": "gh",
"ghcr.io": "gh"
}
}
@itkrt2y
itkrt2y / association.rb
Last active March 11, 2024 22:55
Association dataloader with graphql-ruby
# official docs: https://graphql-ruby.org/dataloader/sources.html
# app/graphql/sources/association.rb
class Sources::Association < ::GraphQL::Dataloader::Source
def initialize(association_name, scope = nil)
@association_name = association_name
@scope = scope
end
def fetch(records)
@Froelund
Froelund / _error.tsx
Last active November 30, 2023 04:35
Next.js Typescript error reporting
import { captureException, flush } from '@sentry/nextjs';
import NextErrorComponent from 'next/error';
import type { ErrorProps } from 'next/error';
import type { NextPage } from 'next';
interface AppErrorProps extends ErrorProps {
err?: Error;
hasGetInitialPropsRun?: boolean;
}
@azu
azu / README.md
Last active January 24, 2024 10:27
GitHub Package Registry and Npm Registry for same scoped does not work @ 2020-01-10

📝 I submit the same text to GitHub Support.


I want to use same scope for npm package and GitHub Package Registry.

For example, @org scope exist in npm and GitHub.

  • @org/foo-public package is public on npm registry
  • @org/bar-private package is private on GitHub Package Registry
@hotatekaoru
hotatekaoru / rails_namespace_rule.md
Last active December 16, 2019 21:25
Class namespace rule in rails project

1. データ取得系

下に行くほど、深度があがる

  • 1-1. View Model / View Object 画面やAPIなど、レスポンスに沿った内容をまとめたオブジェクト
  • 1-2. Collector Object / Finder Object 1つのテーブル、またはそれに関連するテーブルを取得するオブジェクト
  • 1-3. Query Object DBから取得する際に発行するクエリを定義するオブジェクト

1-1. View Model / View Object

@rmosolgo
rmosolgo / page_example.rb
Created April 10, 2019 14:07
Generic page number / per-page pagination with GraphQL-Ruby
# This is a full-blown offset-based pagination system modelled after GraphQL-Ruby's
# built-in connections. It has a few different elements:
#
# - `::Page`, a plain ol' Ruby class for modeling _pages_ of things.
# This class handles applying pagination arguments to lists (Arrays and AR::Relations)
# and provides metadata about pagination. (Similar to `will_paginate`.)
# - `Schema::BasePage` is a generic GraphQL-Ruby object type. It's never used directly,
# but it can generate subclasses which wrap _specific_ object types in the schema.
# - `Schema::BaseObject.page_type` is a convenience method for generating page types
# from your object types. You could leave this out and make subclasses with plain ol'
@voluntas
voluntas / loadtest.rst
Last active April 3, 2024 03:25
負荷試験コトハジメ
@tk0miya
tk0miya / README.md
Last active November 26, 2021 05:41

simple table

| hello | world |
| ----- | ----- |
| hello | world |
| hello | world |

| hello | world |

@Gab-km
Gab-km / github-flow.ja.md
Last active April 14, 2024 08:08 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。