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
""" | |
An example Flask app that uses Exceptions to return errors to clients | |
""" | |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
class APIError(Exception): | |
"""All custom API Exceptions""" |
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 gcr.io/cloud-builders/gcloud | |
RUN apt-get -y update && \ | |
apt-get -y install python3 python3-dev python3-setuptools python3-pip | |
RUN pip3 install PyYAML Jinja2 simplejson kubernetes \ | |
google-cloud-storage google-api-python-client | |
RUN apt-get -y remove python-dev python-setuptools wget && \ | |
rm -rf /var/lib/apt/lists/* && \ |
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
############################################################################################ | |
# A sample Terraform file that creates the cloud build trigger. | |
############################################################################################ | |
resource "google_cloudbuild_trigger" "develop_trigger" { | |
description = "[DEVELOP] Build develop branch" | |
filename = "cloudbuild.yaml" | |
trigger_template { | |
branch_name = "^develop$" | |
repo_name = "houston" | |
} |
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
# Change namespace: | |
kubectl config set-context --current --namespace= | |
# Run a Debug container. Remember to add namespace | |
kubectl run -it --rm --restart=Never alpine --image=alpine sh | |
## The in alpine run | |
apk add curl |
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
DROP TABLE tmp_test_replacing; | |
-- Create a table with the ReplacingMergeTree Engine | |
CREATE TABLE IF NOT EXISTS tmp_test_replacing ( | |
ts Date, | |
sort_var1 String, | |
sort_var2 String, | |
version_var UInt64, | |
indep_var UInt64 | |
) |
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
--- | |
version: '2' | |
services: | |
jupyter: | |
image: jupyter/scipy-notebook | |
container_name: jupyter | |
command: start.sh jupyter lab --LabApp.token='*******************' --LabApp.allow_remote_access='True' --LabApp.allow_origin='*' | |
restart: always |
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
require(rvest) | |
require(stringr) | |
require(data.table) | |
require(tidyverse) | |
library(dplyr) | |
#Specifying the url for desired website to be scraped | |
url <- 'https://www.theguardian.com/uk-news/ng-interactive/2019/mar/27/how-did-your-mp-vote-in-the-indicative-votes' | |
#Reading the HTML code from the website | |
webpage <- read_html(url) |