Skip to content

Instantly share code, notes, and snippets.

View jeromy-vandusen-obs's full-sized avatar

Jeromy Van Dusen jeromy-vandusen-obs

View GitHub Profile

JavaScript Pause Function

Use this function to create a timed delay. This is for things like stubbing APIs in development.

function delay(timeInMs) {
  await new Promise((resolve) => setTimeout(resolve, timeInMs));
}
@jeromy-vandusen-obs
jeromy-vandusen-obs / HelpfulGitAliases.md
Last active February 5, 2021 16:57
Helpful Git Aliases

Helpful Git Aliases

Git Gone

Description

This will remove all deleted remote branches and remove local branches that are tracking a deleted remote branch. This is borrowed from here.

Setup

@jeromy-vandusen-obs
jeromy-vandusen-obs / UsingMavenProfilesToSelectSpringBootDeploymentType.md
Last active January 31, 2020 15:59
Using Maven Profiles to Select Spring Boot Deployment Type

Using Maven Profiles to Select Spring Boot Deployment Type

By default, Spring Boot applications are built as stand-alone executable JARs with an embedded Tomcat. With some additional configuration, a Spring Boot application can be built as a WAR file to deploy to an existing Tomcat, or other servlet container, instance.

These steps can be used to set up a project that can switch easily between building a stand-alone JAR or a WAR for deployment by specifying a Maven profile when building the deployment package. Notes are provided for cases that use other available servlet containers (Jetty and Undertow).

@jeromy-vandusen-obs
jeromy-vandusen-obs / DevelopmentToolsInDockerContainersCheatSheet.md
Last active January 14, 2020 20:43
Development Tools in Docker Containers Cheat Sheet

Development Tools in Docker Containers Cheat Sheet

Add to .bash_profile or .bashrc:

function git() {
  (docker run -it --rm -v ${HOME}:/root -v "$(pwd)":/git bitnami/git:latest "$@")
}

function mvn() {
@jeromy-vandusen-obs
jeromy-vandusen-obs / StaticWebsiteWithRuntimeEnvironmentVariables.md
Created December 23, 2019 19:14
Static Website With Runtime Environment Variables

Static Website With Runtime Environment Variables

Main page (index.html)

<script src="./environment.js"></script>

Environment variables (environment.js)

@jeromy-vandusen-obs
jeromy-vandusen-obs / S3StaticWebsiteCheatSheet.md
Last active September 26, 2019 22:01
S3 Static Website Cheat Sheet

S3 Static Website Cheat Sheet

  1. On the S3 console, click "Create bucket".
  2. On the first page, enter a unique bucket name and preferred region.
  3. On the second page, accept all default settings.
  4. On the third page, uncheck "Block all public access".
  5. On the last page, review the settings and click "Create bucket".
  6. Click into the newly created bucket, and then click "Upload" to upload your static content.
  7. Select the "Properties" tab and then click "Static website hosting".
  8. Check "Use this bucket to host a website", enter the file name of the index document, and then click "Save".
@jeromy-vandusen-obs
jeromy-vandusen-obs / KafkaDevelopmentCheatSheet.md
Last active March 19, 2019 19:48
Kafka Development Cheat Sheet

Kafka Development Cheat Sheet

These instructions assume you have Docker and Docker Compose installed.

To run a local development instance of Kafka, first create the following docker-compose.yml file:

version: '2'
services:
 zookeeper:
@jeromy-vandusen-obs
jeromy-vandusen-obs / AnsibleInstallationCheatSheet.md
Last active November 27, 2018 14:10
Ansible Installation Cheat Sheet

Ansible Installation Cheat Sheet

Install Ansible

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

Docker on a New Virtual Machine - Installation Shortcut

After setting up a new Ubuntu Linux VM and logging in for the first time, copy/paste the following command to update the OS and tools, install Docker CE, install Docker Compose, set the Docker service to automatically start when the OS starts, and add yourself to the Docker group so that you can execute Docker commands. Immediately after submitting this command, you may be prompted for your password. After that, the process will run completely unattended, and will end with a reboot of the VM.

$ sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && sudo apt-get update && sudo apt-get install -y docker-ce && sudo usermod -aG docker $USER && sudo systemctl enable docker && sudo curl -L https://github.com/docker/compose/releases/down
@jeromy-vandusen-obs
jeromy-vandusen-obs / KubernetesCheatSheet.md
Created August 31, 2018 19:48
Kubernetes Cheat Sheet

Kubernetes Cheat Sheet

Basic Commands

Check the versions on the client and server.

$ kubectl version

View information about the master, including its dashboard location.