Skip to content

Instantly share code, notes, and snippets.

View wescpy's full-sized avatar

wesley chun wescpy

View GitHub Profile
@wescpy
wescpy / gist:d6e25e37d732997cfdba6f0fbe9db6a5
Created May 9, 2024 03:37
Vue.js sample calling Google Maps APIs (Geocoding API)
<!DOCTYPE html>
<html>
<head>
<title>Geocoding with Vue</title>
<script src="https://unpkg.com/vue@3"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
<input type="text" v-model="address" placeholder="Enter address">
@wescpy
wescpy / hello-vue.html
Created May 9, 2024 03:35
Vue.js "Hello World" sample generated by Gemini
<!DOCTYPE html>
<html>
<head>
<title>Hello Vue!</title>
<script src="https://unpkg.com/vue@3"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
@wescpy
wescpy / gdgsudbury-workshop.md
Last active May 1, 2024 05:19
Instructions for Wesley Chun workshop at GDG Sudbury 2024 "Build with AI" event

GDG Sudbury: "Build with AI" workshops (2024 May 4)

Google serverless platforms

This workshop is intended on getting you up-to-speed running code on Google as quickly (and as cheaply) as possible on its serverless platforms. Self-link: http://bit.ly/gdgsudbury2024


Exercise 1: Google Workspace (GWS) serverless (Apps Script)

@wescpy
wescpy / ExtractIcon.ps1
Last active October 1, 2023 06:14
PowerShell script that saves .exe icons as .ico files
<#
.SYNOPSIS
Saves .exe/.msi icons as .ico files (to use with Explorer)
.DESCRIPTION
Loops thru all .exe/.msi files in given or current (default)
folder, extracts icons, and saves them as .ico files.
.PARAMETER folder
Optional folder name; if not provided, current ($pwd) is used
.EXAMPLE
(current folder) ExtractIcon
@wescpy
wescpy / google-apis.txt
Last active October 1, 2024 07:36
Google APIs service names/endpoints (Sep 2024)
$ gcloud services list --available --filter="name:googleapis.com"
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
addressvalidation.googleapis.com Address Validation API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
@wescpy
wescpy / templates-index.html
Created November 24, 2021 19:27
Demo app template
<!doctype html>
<html><head><title>Student Information</title><body>
<style>
body {
font-family: Verdana, Helvetica, sans-serif;
background-color: #DDDDDD;
}
table, th, td {
border: 1px solid black;
padding: 4px;
@wescpy
wescpy / main.py
Last active November 24, 2021 19:57
Demo app showing how to call (non-Cloud) Google APIs from GCP serverless platforms
# Copyright 2021 Google LLC
# SPDX-License-Identifier: Apache-2.0
from flask import Flask, render_template
import google.auth
from googleapiclient import discovery
app = Flask(__name__)
CREDS, _PROJECT_ID = google.auth.default()
SHEETS = discovery.build('sheets', 'v4', credentials=CREDS)
@wescpy
wescpy / bug501.py
Created August 12, 2020 10:18
"Unit tester" for Google Auth Library (Python) Bug 501
# https://github.com/googleapis/google-auth-library-python/issues/501
from __future__ import print_function
import os
from google.oauth2 import credentials
TOKENS = 'tokens.json' # OAuth2 token storage
if os.path.exists(TOKENS):
creds = credentials.Credentials.from_authorized_user_file(TOKENS)
if not (creds and creds.valid):