Skip to content

Instantly share code, notes, and snippets.

View Timtech4u's full-sized avatar
🎯
Focusing

Timothy Olaleke Timtech4u

🎯
Focusing
View GitHub Profile
# File: .gitlab-ci.yml
image: docker:latest
stages:
- deploy
deploy:
stage: deploy
image: google/cloud-sdk
services:
@Timtech4u
Timtech4u / garden.yml
Last active March 11, 2020 14:44
Garden configuration file
# garden.yml
kind: Project
name: flask-app
environments:
- name: dev
providers:
- name: kubernetes
context: gke_fullstackgcp_us-central1-c_my-dev-cluster
buildMode: cluster-docker
defaultEnvironment: dev
@Timtech4u
Timtech4u / main.tf
Last active January 23, 2020 18:55
Deploy to Cloud Run using Terraform
# Configure GCP project
provider "google" {
project = "terraform-cr"
}
# Deploy image to Cloud Run
resource "google_cloud_run_service" "mywebapp" {
name = "mywebapp"
location = "us-central1"
template {
@Timtech4u
Timtech4u / Dockerfile
Last active March 20, 2020 08:47
Hello World - A Containerized Flask Web Application
FROM python:3.7-stretch
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["main.py"]
@Timtech4u
Timtech4u / app.yaml
Last active July 26, 2020 21:04
Hello World - Flask Web Application
runtime: python37
@Timtech4u
Timtech4u / main.py
Last active January 5, 2020 09:50
Simple Hello App in Python(Flask)
from flask import jsonify
def hello_world(request):
"""Responds to any HTTP request.
"""
return jsonify({"message": "Hello World"})
<template>
<button id="upload_widget" class="cloudinary-button">Update Logo</button>
</template>
<script>
methoods : {
uploadWidget() {
let myWidget = cloudinary.createUploadWidget(
{
@Timtech4u
Timtech4u / access_token.py
Last active November 17, 2019 21:54
Code snippet to return GCP's access token
import time
import jwt
import json
import requests
import httplib2
# Permissions to request for Access Token
scopes = "https://www.googleapis.com/auth/cloud-platform"
# Length of token's validity
@Timtech4u
Timtech4u / Dockerfile
Last active July 1, 2024 07:13
Snippet for Deploying Containers to Cloud Run Tutorial
FROM python:3.7-stretch
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["app.py"]
/*
* GL05IdleFunc.cpp: Translation and Rotation
* Transform primitives from their model spaces to world space (Model Transform).
*/
// #include <windows.h> // for MS Windows
#include <GL/glut.h> // GLUT, include glu.h and gl.h
// Global variable
GLfloat angle = 0.0f; // Current rotational angle of the shapes