Skip to content

Instantly share code, notes, and snippets.

View nownabe's full-sized avatar
💪
Yeah!!

Shogo Watanabe nownabe

💪
Yeah!!
View GitHub Profile
@nownabe
nownabe / main.go
Created April 7, 2022 12:54
Firestore Emulator test
package main
import (
"context"
"fmt"
"io"
"net/http"
"os"
"cloud.google.com/go/firestore"
@nownabe
nownabe / Authentication_Cloud_Run.md
Last active March 4, 2022 07:29
開発者が Cloud Run へ認証する方法

免責

これは非公式ドキュメントです。本番環境へ適用する前に、公式ドキュメントを参照するかご自身での手順のテストをお願いいたします。

This is not an official document. Before using it as production, you should refer to official documentations or test the instructions on yourself.

Written by Shawn Watanabe (Google Cloud Customer Engineer)

Last modified at 2022-03-04.

@nownabe
nownabe / block.rb
Last active July 8, 2019 22:27
Ruby block chain performance
require "benchmark/ips"
class A
def meth1(&block)
meth2(&block)
end
def meth2
yield
end
@nownabe
nownabe / deployment.yaml
Created August 22, 2018 13:38
Deserialize Kubernetes objects in Go
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: my-namespace
name: memcached
spec:
replicas: 1
selector:
matchLabels:
app: memcached
@nownabe
nownabe / instagram.rb
Created April 6, 2018 04:05
Instagram GraphQL API
# frozen_string_literal: true
require "faraday"
require "faraday_middleware"
endpoint = "https://www.instagram.com/graphql/query/"
# query_hash = "42323d64886122307be10013ad2dcc44"
# variables = '{"id":"3872941487","first":12,"after":"AQANkBj-f-ZzmLfmYiXU6qjC7nnHbpPttpppOPrL-i6mESM7hl04zzC50sCvA-RC3PFI98BtktoArwP9Ani1Z4dY067A1S6xvvhFqfgyJXJ5qw"}'
# csrf_token = "HIzZV98ydKLQmM6hGTtovnlqnrFwhsDf"
@nownabe
nownabe / rename.rb
Last active March 23, 2018 03:59
Renamer
# frozen_string_literal: true
require "color_echo"
patterns = {
/oldname/ => "newname",
}
skip_files = [
/^\.git\//,
@nownabe
nownabe / main.go
Created March 13, 2018 01:03
Go map memory
package main
import (
"fmt"
"runtime"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
@nownabe
nownabe / pre-commit
Created January 11, 2018 01:34
Go pre-commit
#!/bin/bash
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$')
[[ -z "${gofiles}" ]] && exit 0
make pre-commit
@nownabe
nownabe / .commit_template
Last active January 24, 2018 08:34
Emoji Commit Prefix
# ==== Emojis ====
# 🌟 :sparkles: Adds a new feature or updates an existing feature
# 🐛 :bug: Fixes a bug
# ⚡ :zap: Improves performance of a feature
# 🔒 :lock: Fixes a security issue
# 🚿 :shower: Refactors an existing feature
# 👕 :tshirt: Fixes a code style violation
# 🔥 :fire: Deletes useless features, codes or files
# 📝 :pencil: Adds or updates a documentation
# 👮 :cop: Adds missing tests or correcs existing tests
@nownabe
nownabe / test_gems.sh
Last active September 24, 2017 01:39
GemTester Script
#!/bin/bash
function install_build_dependencies_ubuntu() {
sudo apt-get install -y \
git ruby autoconf bison gcc make zlib1g-dev libffi-dev \
libreadline-dev libgdbm-dev libssl-dev
}
function install_test_dependencies_ubuntu() {
sudo apt-get install -y \