Skip to content

Instantly share code, notes, and snippets.

View andrewfinnell's full-sized avatar

Andrew T. Finnell andrewfinnell

View GitHub Profile
@andrewfinnell
andrewfinnell / README.md
Last active September 24, 2020 14:44
WSL SSH Server

Installation

Install SSHD

sudo apt install openssh-server

Configure SSH Server

@andrewfinnell
andrewfinnell / material.module.ts
Created September 1, 2020 23:25
Angular Material Module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatButtonModule} from '@angular/material/button';
import {MatInputModule} from '@angular/material/input';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatFormFieldModule} from '@angular/material/form-field';
@andrewfinnell
andrewfinnell / XRDP.MD
Last active May 28, 2020 19:22
Setup XRDP - Hyper-V

Install XRDP (Did I need it from the repo? I don't know because I did both) but vsock needs to be enabled.

sudo apt update
sudo apt dist-upgrade
sudo apt install xrdp
echo mate-session> ~/.xsession
sudo apt-get install mate-core
sudo ufw allow 3389/tcp
@andrewfinnell
andrewfinnell / remove-k8s-dashboard.sh
Last active February 20, 2024 15:09
Remove Kubernetes Dashboard with Namespace Support
#!/bin/bash
kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
## OR
kubectl get deployments -A
kubectl delete service kubernetes-dashboard --namespace=kubernetes-dashboard
kubectl delete service dashboard-metrics-scraper --namespace=kubernetes-dashboard
kubectl delete sa kubernetes-dashboard --namespace=kubernetes-dashboard
@andrewfinnell
andrewfinnell / README.MD
Last active May 14, 2019 02:18
Largest Common Subsequence (Google Interview Question)

I saw this interview question at https://www.youtube.com/watch?v=10WnvBk9sZc and wanted to see if I was able to solve it. The code is not pretty but it does work. No maps are needed. No state tracking is needed, except for storing the current largest subsequence. Once a larger one is found, the previous one is no longer needed.

The basic concept is to start with the smallest string first as the string which is the largest cannot possibly be completely found in the smaller string. i.e. ABCDE could not ever completely match ABCD. But ABCD can sub match ABCDE.

If this calculation was to be done by a human, we would start at the first letter in the string and then start searching the second string until we found a match. Once we found a match, we would go back to the first string and grab the next letter and then continue searching the second string again; skipping any non-matching letters along the way. We would need to make sure to pick up

(#[a-zA-Z][a-zA-Z0-9_]+-[1-9][0-9]*)([^.]|\.[^0-9]|\.$|$)
@andrewfinnell
andrewfinnell / package.json
Last active December 11, 2018 03:27
Simple webpack.config.js
{
"name": "testwebpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"author": "",
@andrewfinnell
andrewfinnell / Semver.regex
Created November 9, 2018 21:04
SemVer Regex
^(v?|r?|b?)([1-9][0-9]?)\.([0-9]+)?\.?([0-9]+)?\.?([\w\d]+)?(-[\w\d]+)?$
@andrewfinnell
andrewfinnell / IkvmMavenMojo.java
Created November 4, 2018 21:48
IkvmMavenMojo.java
//
// ikvm-maven-plugin - generates C# DLL from Java code via IKVM
// http://github.com/samskivert/ikvm-maven-plugin/blob/master/LICENSE
package com.samskivert;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@andrewfinnell
andrewfinnell / Calculations.md
Last active October 1, 2024 20:38
Heroes of the Storm - MVP Calculation
  • add kills

  • add assists x [LostVikings=0.75, Abathur=0.8, other=1]

  • add (timeSpentDead / gameLength) x 100 x [Murky=-1, Gall=-1, Cho=-0.85, other=-0.5]

  • add 1 if player has top hero damage of his team

  • add 1 if player has top hero damage of the match