Skip to content

Instantly share code, notes, and snippets.

View SpicySyntax's full-sized avatar

Nick Purcell SpicySyntax

  • Matterport
  • Chicago, IL
View GitHub Profile
@SpicySyntax
SpicySyntax / dataflow_hook.py
Created February 25, 2021 17:01
Airflow Workaround for Dataflow Flex Template Execution
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
@SpicySyntax
SpicySyntax / CrackClassifier.py
Created September 20, 2019 15:33
Keras Crack Classifier
import tensorflow as tf
from IPython.display import display
from PIL import Image
import keras
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import math
print(tf.__version__)
print(keras.__version__)
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- image: nginx:1.15.5
name: mypod
resources:
requests:
@SpicySyntax
SpicySyntax / deployment.yaml
Created August 26, 2019 16:37
Persistent Volume Stuff
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "crack-detection-classification.fullname" . }}
namespace: {{ .Values.general.namespace }}
labels:
app: {{ template "crack-detection-classification.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
@SpicySyntax
SpicySyntax / Dockerfile
Last active August 14, 2019 16:54
Python ML AZ Func
FROM mcr.microsoft.com/azure-functions/python:2.0
COPY . /home/site/wwwroot
RUN cd /home/site/wwwroot && \
pip install -r requirements.txt
@SpicySyntax
SpicySyntax / ImageQueueTrigger.cs
Created July 9, 2019 15:40
Queue Trigger not working
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage.Queue;
using Newtonsoft.Json;
using ObjectDetection.Models;
using ObjectDetection.Services;
@SpicySyntax
SpicySyntax / obj-det-ingress.yaml
Created July 8, 2019 15:56
Nginx Ingress Self-Signed
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: obj-det-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, DELETE, GET, POST, OPTIONS"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://objectdetectionstorageqa.z19.web.core.windows.net/"
@SpicySyntax
SpicySyntax / cluster-issuer.yaml
Created June 12, 2019 20:33
Nginx Ingress Controller
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
namespace: ingress-basic
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: Nick.Purcell@bentley.com
privateKeySecretRef:
import { Log, User, UserManager } from 'oidc-client';
import { Constants } from '../helpers/Constants';
export class AuthService {
public userManager: UserManager;
constructor() {
const settings = {
authority: Constants.stsAuthority,
@SpicySyntax
SpicySyntax / Dockerfile
Last active May 21, 2019 18:14
Crack Segmentation
FROM mcr.microsoft.com/azure-functions/python:2.0
COPY . /home/site/wwwroot
RUN cd /home/site/wwwroot && \
pip install -r requirements.txt