Skip to content

Instantly share code, notes, and snippets.

@voluntas
voluntas / open_ayame.rst
Last active February 19, 2024 16:25
OpenAyame プロジェクト
@sbuss
sbuss / main.go
Last active August 15, 2019 20:23
Stackdriver logging with request grouping for App Engine Go 1.11
// Sample logging-quickstart writes a log entry to Stackdriver Logging.
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
@pottava
pottava / prep-container-engine-for-prod.md
Last active August 26, 2020 09:37
本番環境のための GKE 構築 Tips

プロジェクト・ネットワーク・クラスタの構成

プロジェクト

  • GCP のすべてのリソースは プロジェクト の下に作成される
  • プロジェクトごとに請求や IAM の管理が可能
  • 本番やステージングといった複数環境のリソースを分離するためにもプロジェクトで分けよう
@sandeepraju
sandeepraju / ttfb.sh
Created July 20, 2016 21:17
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@pokstad
pokstad / gaereverseproxy.go
Last active October 24, 2021 09:35
Google App Engine reverse proxy in Golang
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package goengine
import (
"io"
@masuidrive
masuidrive / main.js
Last active May 5, 2023 17:54
Google SpreadsheetからBigQueryを呼び出すスクリプト
/**
* Google Spreadsheet向けBigQuery取り込みスクリプト
* http://toreta.blog.jp/archives/20649904.html
* License: MIT 2014- Toreta, Inc.
*
* runAllQueries() をトリガーで毎日実行してください
* Queries, Single row queries, Dataの三つのシートを作って下さい
* Queries, Single row queriesのシートには実行するクエリを書きます
* A列にクエリ名、B列にクエリです。
* conuntなどの集約関数で1行しか返らないクエリは「Single row queries」、それ以外は「Queries」に書いて下さい
@Ovinatter
Ovinatter / Auth.go
Created December 15, 2014 10:24
GAE/GOで認証
func Handler(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
u := user.Current(c)
//ログインのチェック
if u == nil {
url, err := user.LoginURL(c, r.URL.String())
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@tejainece
tejainece / StreamToString.go
Created April 2, 2014 18:29
Golang: io.Reader stream to string or byte slice
import "bytes"
func StreamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
buf.ReadFrom(stream)
return buf.Bytes()
}
func StreamToString(stream io.Reader) string {
buf := new(bytes.Buffer)