This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"cloud.google.com/go/compute/metadata" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cron: | |
- description: Daily Backup | |
url: /_ah/datastore_admin/backup.create?name=BackupToCloud&kind=Billing&kind=Project&filesystem=gs&gs_bucket_name=datastore-backup&queue=backup | |
schedule: every day 02:00 | |
timezone: Asia/Tokyo | |
target: ah-builtin-python-bundle | |
- description: Billing Report to Slack | |
url: /cron/1/billing/ratio | |
schedule: every day 10:00 | |
timezone: Asia/Tokyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ttlify() { | |
local i | |
for i in "$@"; do | |
[[ "${i}" =~ ^([0-9]+)([a-z]*)$ ]] || continue | |
local num="${BASH_REMATCH[1]}" | |
local unit="${BASH_REMATCH[2]}" | |
case "${unit}" in | |
weeks|week|wee|we|w) unit=''; num=$[num*60*60*24*7];; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cpt | |
import ( | |
"google.golang.org/appengine" | |
"golang.org/x/net/context" | |
) | |
// IsProduction is Production環境で動いていればtrueを返す | |
func IsProduction(c context.Context) bool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "documentSentiment", | |
"type": "RECORD", | |
"fields": [ | |
{ | |
"name": "magnitude", | |
"type": "FLOAT", | |
"mode": "NULLABLE" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/zabawaba99/firego" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"name": "entities", | |
"mode": "repeated", | |
"type": "record", | |
"fields": [{ | |
"name": "mentions", | |
"mode": "repeated", | |
"type": "record", | |
"fields": [{ | |
"name": "text", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
) | |
func init() { | |
http.HandleFunc("/.well-known/acme-challenge/", handlerLetsencypt) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gcs_sample | |
import ( | |
"net/http" | |
"fmt" | |
"google.golang.org/appengine" | |
"google.golang.org/appengine/log" | |
"golang.org/x/oauth2/google" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function passthroughExample(row, emit) { | |
var output = []; | |
row.keyword. forEach(function(element, index, array) { | |
var match = row.data.match(element); | |
if (match) { | |
output.push(match[0]); | |
} | |
}) | |
emit({output:output}) | |
} |