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
from django.core.cache import cache, caches | |
from django.conf import settings | |
from django.db.models.query import QuerySet | |
DEFAULT_CACHE_ALIAS = 'default' | |
def _get_cache(cache_alias): | |
# did this because debug toolbar does not track caches when not using just cache. | |
# So, caches["default"] is not tracked |
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
import os | |
import json | |
import zlib | |
from base64 import b64decode | |
from google.cloud import bigquery | |
from google.oauth2 import service_account | |
TABLE_NAME = "<project_id>.<dataset>.<table-name>" |
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
set hls ic is nu noswf | |
set hlsearch " 모든 검색결과 하이라이트 | |
set ignorecase " 대소문자 무시하고 검색 | |
set incsearch " 타이핑할 때마다 검색 결과 표시 | |
set number " 줄번호 표시 | |
set noswapfile " 스왑파일 사용안함 | |
set smartcase |
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
# Load BigQuery from the Python GCP Library | |
from google.cloud import bigquery | |
# Load a performance timer (optional or comment out) | |
from timeit import default_timer as timer | |
# Specify your fully-qualified table name as you would in the UI | |
import_table = 'YOUR-DATASET.bortdata.bookdata' | |
# Choose the GCS bucket and file, or override it with a full gs:// URI | |
gcs_bucket = 'YOUR-BUCKET' | |
gcs_file = 'book-data.csv' | |
# gs://mybucket/book-data.csv OR local file ./book-data.csv |
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
<!DOCTYPE html> | |
<html> | |
<!-- | |
Copyright 2016 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
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
Task1 | |
# SSH into jumphost | |
cd /work/sample-app | |
gcloud config set compute/zone us-east1-d | |
gcloud container clusters get-credentials jenkins-cd --zone us-east1-b | |
kubectl create ns production | |
kubectl apply -f k8s/production -n production | |
kubectl apply -f k8s/canary -n production | |
kubectl apply -f k8s/services -n production |
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
1) | |
``` | |
CREATE OR REPLACE TABLE taxirides.taxi_training_data ( | |
`pickup_datetime` TIMESTAMP, | |
`pickuplon` FLOAT64, | |
`pickuplat` FLOAT64, | |
`dropofflon` FLOAT64, | |
`dropofflat` FLOAT64, | |
`passengers` FLOAT64, | |
`fare_amount` FLOAT64 |
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
# https://google.qwiklabs.com/focuses/12704?parent=catalog | |
# Dataset: image_classification_dataset | |
# Table name: image_text_detail | |
import os | |
import sys | |
# Import Google Cloud Library modules | |
from google.cloud import storage, bigquery, language, vision, translate_v2 | |
if ('GOOGLE_APPLICATION_CREDENTIALS' in os.environ): |
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
const MY_DOMAIN = "agodrich.com" | |
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
const DISQUS_SHORTNAME = "agodrich" | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", |
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
# Get a local Shell of container | |
docker run -i -t --entrypoint /bin/bash imageID | |
# Create image using this directory's Dockerfile | |
docker build -t friendlyname . | |
# Run "friendlyname" mapping port 4000 to 80 | |
docker run -p 4000:80 friendlyname | |
# Same thing, but in detached mode | |
docker run -d -p 4000:80 friendlyname | |
# See a list of all running containers | |
docker ps |
NewerOlder