Skip to content

Instantly share code, notes, and snippets.

Grant Timmerman grant

Block or report user

Report or block grant

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
grant / Dockerfile
Created Nov 19, 2019
YouTube API on Cloud Run Dockerfile
View Dockerfile
# Use the official lightweight Python image.
FROM python:3.7-slim
# Copy local code to the container image.
COPY . ./
# Install production dependencies.
grant /
Created Nov 19, 2019
YouTube API on Cloud Run – Deploy Script
# !/bin/bash
# Set env var "GCP_PROJECT" to our project name
GCP_PROJECT=$(gcloud config list --format 'value(core.project)' 2>/dev/null)
# Set our Cloud Run region (so we aren't prompted)
gcloud config set run/region us-central1
# Build and upload your image in Google Container Registry
gcloud builds submit --tag$GCP_PROJECT/yt
# Deploy your container to Cloud Run
ENV=$(cat .env)
grant /
Created Nov 19, 2019
YouTube API on Cloud Run
import os
import argparse
from dotenv import load_dotenv
from flask import Flask, request
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
# Setup YouTube API
KEY = os.environ.get('KEY')
grant / main.go
Last active Nov 6, 2019
Go Functions Framework – main
View main.go
package main
import (
grant / function.go
Created Nov 6, 2019
Go Functions Framework – Hello, World
View function.go
package hello
import (
// HelloWorld writes "Hello, World!" to the HTTP response.
func HelloWorld(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, World!\n")
grant / index.js
Last active Nov 4, 2019
Pizza App Routes
View index.js
const express = require('express');
const app = express();
const routes = {
'/foo': (req, res) => res.send('This is a test.'),
Object.entries(routes).map(([route, func]) => app.use(route, func));
app.use('/', (req, res) => res.send(Object.keys(routes))); // default
// Export the Express app to the Functions Framework
exports.function = app;
grant / index.js
Last active Oct 17, 2019
Cloud Tasks – Create HTTP Task
View index.js
const parent = client.queuePath(project, location, queue);
const task = {
httpRequest: {
httpMethod: 'POST',
const [response] = await client.createTask({parent, task});
grant / pizza.json
Created Sep 25, 2019
Maps Find Place API Result
View pizza.json
"formatted_address":"11 Park Pl, New York, NY 10007, United States",
grant / cities.txt
Created Sep 18, 2019
cities.txt – small
View cities.txt
Viti, Kosovo
Shtërpcë, Kosovo
Shtime, Kosovo
Vushtrri, Kosovo
Bonney Lake, United States
Spokane Valley, United States
Bellevue, United States
Marysville, United States
Newcastle, United States
North Bend, United States
View cities.txt
Malishevë, Kosovo
Prizren, Kosovo
Zubin Potok, Kosovo
Kamenicë, Kosovo
Viti, Kosovo
Shtërpcë, Kosovo
Shtime, Kosovo
Vushtrri, Kosovo
Dragash, Kosovo
Podujevë, Kosovo
You can’t perform that action at this time.