This file contains hidden or 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 hidden or 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 | |
# Install google-fluentd | |
curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh | |
sha256sum install-logging-agent.sh | |
sudo bash install-logging-agent.sh | |
# Restart google-fluentd | |
service google-fluentd restart | |
# Your Task |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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}) | |
} |
This file contains hidden or 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 goonchk | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/mjibson/goon" | |
"google.golang.org/appengine/datastore" | |
) |