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
| resource "google_storage_bucket" "website" { | |
| name = "${local.prefix}-sbt-website" | |
| location = "US" | |
| force_destroy = true | |
| website { | |
| main_page_suffix = "index.html" | |
| } | |
| } |
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
| provider "aws" { | |
| region = "us-east-1" | |
| alias = "us_east_1" | |
| } | |
| resource "aws_acm_certificate" "cert" { | |
| provider = aws.us_east_1 | |
| domain_name = var.site_domain | |
| subject_alternative_names = ["*.${var.site_domain}"] | |
| validation_method = "DNS" |
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 { Configuration } from 'webpack'; | |
| import MiniCssExtractPlugin from 'mini-css-extract-plugin'; | |
| import HtmlWebpackPlugin from 'html-webpack-plugin'; | |
| const electron: Configuration = { | |
| target: 'electron-main', | |
| entry: './src/main/index.ts', | |
| output: { | |
| filename: 'main.js', |
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 datetime import datetime | |
| import re | |
| long_date = r"(January|February|March|April|May|June|July|August|September|October|November|December) (0?[1-9]|1[0-9]|2[0-9]|30|31), (19|20)[0-9][0-9]" | |
| short_date = r"(0?[1-9]|1[0-2])(-|\/)(0?[1-9]|1[0-9]|2[0-9]|30|31)\2(19|20)[0-9][0-9]" | |
| extra_long_date = r"the (1st|2nd|3rd|[4-9]th|1[0-9]th|20th|21st|22nd|23rd|2[4-9]th|30th|31st) of (January|February|March|April|May|June|July|August|September|October|November|December), (19|20)[0-9][0-9]" | |
| def convert_long_date(long_date): | |
| return datetime.strptime(long_date, '%B %d, %Y').strftime('%Y-%-m-%-d') |
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 numpy as np | |
| def get_region(matrix, x1, x2, y1, y2): | |
| return matrix[y1:y2,x1:x2] | |
| def compute_gradients(matrix, axis): | |
| gradients = np.zeros(shape=matrix.shape) | |
| if axis == 0: | |
| for i in range(matrix.shape[0] - 1): | |
| gradients[i,:] = matrix[i+1,:] - matrix[i,:] |
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
| def k_fold(X, y, estimator, k): | |
| # assuming that the data is already shuffled | |
| n = len(X) | |
| s = n / k | |
| score = 0 | |
| for i in range(k): | |
| X_train = X[0:i*s] + X[(i+1)*s:-1] | |
| y_train = y[0:i*s] + y[(i+1)*s:-1] |
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 numpy as np | |
| def mean_iou(labels, predictions, n_classes): | |
| mean_iou = 0.0 | |
| seen_classes = 0 | |
| for c in range(n_classes): | |
| labels_c = (labels == c) | |
| pred_c = (predictions == c) |
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 shiftwidth=2 | |
| set tabstop=2 | |
| set smarttab | |
| set autoindent | |
| set smartindent | |
| set number | |
| highlight LineNr ctermfg=green |