Skip to content

Instantly share code, notes, and snippets.

@lewisrodgers
lewisrodgers / README.md
Last active April 9, 2024 09:50
Python boilerplate for service account oauth setup to return data from a Google API

Prerequisites

For a more detailed version of the steps below visit: https://developers.google.com/admin-sdk/directory/v1/guides/delegation

  • Enable the necessary APIs (calendar, drive, gmail, etc.) in Cloud Console
  • Create a service account, download the json key file, and enable domain wide delegation (DwD)
  • Determine the required scopes (calendar readonly, drive read/write, etc.)
  • In the G Suite console, an admin authorizes the service account (client ID) with the specified scopes
  • The admin also identifies an account — with proper admin privileges — that the service account will impersonate (when you want to access user's data without manual authorization from the user)
@jerrellmardis
jerrellmardis / ExponentialBackoff
Last active June 3, 2019 13:10
Exponential Backoff using Rx.retryWhen()
// retries up to 3 times while exponentially backing off with each retry
.retryWhen(errors ->
errors
.zipWith(
Observable.range(1, MAX_RETRIES), (n, i) -> i
)
.flatMap(
retryCount -> Observable.timer((long) Math.pow(4, retryCount), TimeUnit.SECONDS)
)
)
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@tomykaira
tomykaira / gitlt.md
Created July 21, 2012 12:16
SCMBC 3rd の闇LT資料です

git の一歩その先に

git を自分色に染めあげる

by. @tomy_kaira (License: CC-BY-SA)

git 使いへの道

  • git いれる
  • コミットしたりしてみる
@motemen
motemen / cool.txt
Created April 20, 2011 11:38
魔法少女まどか☆マギカ 最終回放送スケジュール
_人人人人人人人人人人人人人人人人人人人人人人人人人人_
>  魔法少女まどか☆マギカ 最終回放送スケジュール  <
 ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄
2011/04/21
26:00 27:00 28:00 29:00
|-----------|-----------|-----------|
MBS (関西) |-------111111222222----|-----------|
TBS (関東) |-------:---000000111111222222------|
: : : :