Skip to content

Instantly share code, notes, and snippets.

View peavers's full-sized avatar
💭
I'm ready. Lets go.

Chris Turner peavers

💭
I'm ready. Lets go.
  • Seattle, Washington
View GitHub Profile
@peavers
peavers / git-cheats.sh
Last active February 13, 2024 15:47
Quick helper for git commands when dealing with fussy tech leads
##################
# Squashing all commits to a single commit on your feature branch
git checkout feature_branch
git reset --soft develop #Whatever branch you're merging into
git add -A
git commit -m "feat: Add new meaningful feature"
git push
##################
@peavers
peavers / purge.sh
Created March 24, 2021 16:45
Bulk delete workflows from GitHub Actions
# Requires GitHub CLI installed and authenticated.
export USER=""
export REPO=""
export BRANCH="master"
gh api repos/$USER/$REPO/actions/runs | jq -r '.workflow_runs[] | select(.head_branch == "master") | "\(.id)"' | xargs -n1 -I % gh api repos/$USER/$REPO/actions/runs/% -X DELETE > out.log 2> /dev/null
@peavers
peavers / firestore-scroll.service.ts
Last active February 3, 2023 15:47
Enables infinite/virtual scrolling with ngx-virtual-scroller and Firestore
import {Injectable} from '@angular/core';
import {BehaviorSubject, Observable} from "rxjs";
import {AngularFirestore} from "@angular/fire/firestore";
import {map, mergeMap, scan, tap, throttleTime} from "rxjs/operators";
import {ChangeEvent} from "ngx-virtual-scroller";
/**
* Enables infinite scrolling with ngx-virtual-scroller and Firestore. Most of the hard work goes to
* https://angularfirebase.com/lessons/infinite-virtual-scroll-angular-cdk.
*
@peavers
peavers / docker-compose.yml
Created August 16, 2020 10:26
docker-compose file for media server
version: "3"
services:
# https://hub.docker.com/_/traefik
traefik:
container_name: traefik
image: traefik:v2.2
restart: unless-stopped
command:
- --api
@peavers
peavers / colors.json
Created January 2, 2022 06:00
Random colors with name and hex
[
{
"name": "boysenberry",
"hex": "#873260"
},
{
"name": "tea_green",
"hex": "#d0f0c0"
},
{
@peavers
peavers / FluxUtils.java
Last active October 30, 2021 21:59
Utility class for working with Flux publishers.
import java.time.Duration;
import lombok.experimental.UtilityClass;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.util.function.Tuple2;
@UtilityClass
public class FluxUtils {
/**
@peavers
peavers / AboutDialog.java
Last active October 20, 2021 02:55
Standalone "About" dialog for apps that just run in the task tray.
package space.forloop.stardew.desktop.system;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import space.forloop.stardew.desktop.utils.ImageUtils;
@peavers
peavers / docker-compose.yml
Last active April 17, 2021 07:35
SonarQube for SonarQube docker-compose snippet
sonarqube:
container_name: sonarqube
image: sonarqube:latest
restart: unless-stopped
cpus: 0.5
mem_limit: 4096M
mem_reservation: 1024M
ports:
- 9000:9000
environment:
@peavers
peavers / .env
Created April 17, 2021 07:10
Complete SonarQube with reverse proxy
# SSL Certificates
DOMAIN=example.copm # Set this to the domain you want a certificate for, sonar will be available at it on /sonar
EMAIL=sonar@example.com # Need a valid email for the certificate generation
# Directories
USERDIR=/${HOME}/docker # Change this to where you'd like to store SonarQube configuration on your host machine
# Sonar
SONAR_DATABASE_USER=sonar # Make sure to change this
SONAR_DATABASE_PASSWORD=sonar # Make sure to change this
@peavers
peavers / .env
Created April 17, 2021 07:02
SonarQube env file
# SSL Certificates
DOMAIN=example.copm # Set this to the domain you want a certificate for, sonar will be available at it on /sonar
EMAIL=sonar@example.com # Need a valid email for the certificate generation
# Directories
USERDIR=/${HOME}/docker # Change this to where you'd like to store SonarQube configuration on your host machine
# Sonar
SONAR_DATABASE_USER=sonar # Make sure to change this
SONAR_DATABASE_PASSWORD=sonar # Make sure to change this