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
| 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 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
| 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 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
| set hls ic is nu noswf | |
| set hlsearch " ๋ชจ๋ ๊ฒ์๊ฒฐ๊ณผ ํ์ด๋ผ์ดํธ | |
| set ignorecase " ๋์๋ฌธ์ ๋ฌด์ํ๊ณ ๊ฒ์ | |
| set incsearch " ํ์ดํํ ๋๋ง๋ค ๊ฒ์ ๊ฒฐ๊ณผ ํ์ | |
| set number " ์ค๋ฒํธ ํ์ | |
| set noswapfile " ์ค์ํ์ผ ์ฌ์ฉ์ํจ | |
| set smartcase |
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
| # 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 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
| <!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 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
| 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 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
| 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 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
| # 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 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
| 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 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
| # 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