Skip to content

Instantly share code, notes, and snippets.

View J-Swift's full-sized avatar

Jimmy Reichley J-Swift

  • Rockledge, FL
View GitHub Profile
@J-Swift
J-Swift / __etc__nginx__nginx.conf
Last active September 6, 2019 19:28
Basic nginx conf for multiple static sites on single host
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user www-data www-users;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@J-Swift
J-Swift / TokenAuthInterceptor.ts
Created September 26, 2019 19:57
ngUpgrade compatible Angular2 shim for ng-token-auth
import { Injectable, Inject } from '@angular/core';
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
import { Observable } from 'rxjs';
import { INgTokenAuthService } from './ng-token-auth';
@Injectable()
export class TokenAuthInterceptor implements HttpInterceptor {
constructor(
@J-Swift
J-Swift / ssh_to.sh
Last active April 10, 2022 21:01
Convenience script to intelligently connect to a kubernetes pod/node given the API name
#!/usr/bin/env bash
set -eu
readonly mode="${1:-}"
readonly target="${2:-}"
readonly ssh_key_path="path_to_kops_ssh_key"
die() {
@J-Swift
J-Swift / find_images_gamelist.sh
Last active April 10, 2022 21:01
Detect what retropie rom directories dont have all their metadata
#!/usr/bin/env bash
readonly target_dir="${1:-}"
if [ -z "${target_dir}" ] || ! [ -d "${target_dir}" ]; then
echo "ERROR: doesnt exist or isnt a directory [${target_dir}]"
exit 1
fi
readonly RED=$( tput setaf 1 )
@J-Swift
J-Swift / index.js
Last active March 14, 2020 18:55
Puppeteer - get recent BBT transactions
const chromium = require('chrome-aws-lambda');
const chalk = require('chalk');
const USERNAME = process.env.USERNAME;
const PASSWORD = process.env.PASSWORD;
const DEFAULT_TIMEOUT = 5000;
const hl_info = chalk.bold.white;
const info = chalk.gray;
const positive = chalk.green;
@J-Swift
J-Swift / docker_golang_test_runner.sh
Created April 14, 2020 02:35
Run tests for current golang project within a container to work around various OSX/nix env issues
docker run -it --rm -v $(PWD):/app golang:alpine /bin/sh -c "cd /app; CGO_ENABLED=0 go test ./..."
@J-Swift
J-Swift / add_chase_credit_card_reward.js
Last active November 15, 2021 16:14
Programmatically add all available chase credit card rewards
await (async function wrapper() {
const accountDropdownSelector = 'mds-select mds-select-option';
const addDealSelector = '.sixersoffers__container .iconAddToCard';
const closeFlyoutSelector = 'flyoutClose';
const offerInfoTitleSelector = '.offerdetails__offer-info .offerdetails__info-one';
const offerInfoAmountSelector = '.offerdetails__offer-info .offered-amount-info';
const defaultDelayMs = 1000;
const defaultMaxWaitMs = 1000;
@J-Swift
J-Swift / BindableProperty.snippet
Created May 14, 2020 19:19
Xamarin.Forms BindableProperty Property
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<shortcut>bp</shortcut>
<Title>Bindable Property</Title>
<Author>Jimmy Reichley</Author>
<Description>Inserts boilerplate for BindableProperty property</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@J-Swift
J-Swift / .editorconfig
Last active August 10, 2020 17:09
C# monorepo style example
# NOTE(jpr): adapted from https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019
root = true
#### Core EditorConfig Options ####
[*]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
@J-Swift
J-Swift / git-rm-merged.ps1
Created August 19, 2020 15:45
Delete merged git feature branches in powershell
git branch --merged | Select-String -Pattern 'feature' | %{ git branch -d $_.Line.Trim() }