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 / resque_check.sh
Last active December 4, 2015 03:01
Resque status CLI script
# Turns the number of seconds elapsed into an appropriate stringified description
function seconds_to_human_readable()
{
local SECONDS=$1
if [ ${SECONDS} -lt 1 ]; then
RESULT="just now"
elif [ ${SECONDS} -lt 60 ]; then
RESULT="${SECONDS} seconds"
elif [ ${SECONDS} -lt 3600 ]; then
#!/usr/bin/env bash
set -euo pipefail
##########
# Config #
##########
readonly GIT_BRANCH='android-8.0.0_r4'
readonly API_LEVEL='26'
@J-Swift
J-Swift / git-stash-staged
Created July 18, 2018 01:42
Custom git command to stash only the staged changes
#!/usr/bin/env bash
# https://stackoverflow.com/a/39644782/1273175
((!$#)) && echo 'Must provide a stash name!' && exit 1
if ! $( git status --porcelain | grep -v '??' | grep -E '^[^ ]' --silent ); then
echo 'No staged changes detected!'
exit 1
fi
@J-Swift
J-Swift / get_swift_toolchain_id.sh
Created September 6, 2018 18:27
Get swift toolchain id from toolchain download name
#!/usr/bin/env bash
readonly target_swift_toolchain_name='swift-4.1.3-RELEASE.xctoolchain'
readonly toolchain_plist_file_path="/Library/Developer/Toolchains/${target_swift_toolchain_name}/Info.plist"
if [ ! -f "${toolchain_plist_file_path}" ]; then
echo
echo "ERROR: no toolchain found at [${toolchain_plist_file_path}]"
exit 1
fi
@J-Swift
J-Swift / pods_by_node.sh
Created December 4, 2018 19:02
Show aks pods by node
#!/usr/bin/env bash
set -euo pipefail
readonly temp_dir=$( mktemp -d )
# sudo kubectl get pods
# NAME READY STATUS RESTARTS AGE
# azure-vote-back-655476c7f7-gvg7b 1/1 Running 0 24m
# azure-vote-front-7f98fd48d4-8fkcd 1/1 Running 0 18m
@J-Swift
J-Swift / ProjectName.csproj
Created January 24, 2019 15:50
Multi-targeted .netstandard csproj in VS for Mac
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;Xamarin.iOS10;MonoAndroid81;</TargetFrameworks>
<SynchReleaseVersion>false</SynchReleaseVersion>
<DefineConstants>$(DefineConstants);</DefineConstants>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Configurations>Debug;Release;</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
@J-Swift
J-Swift / .bash_aliases
Created February 11, 2019 04:32
bash alias to exit if no jobs suspended
function fge() {
# https://unix.stackexchange.com/a/251050
local -r num_suspended=$(jobs -s | wc -l)
if [ $num_suspended -eq 0 ]; then
exit
else
fg
fi
}
evaluating file '/nix/store/1jz25hcma179wbpi56blgajw47n5kgqd-nix-2.2.1/share/nix/corepkgs/derivation.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/default.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/lib/minver.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/pkgs/top-level/impure.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/pkgs/top-level/default.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/pkgs/stdenv/booter.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/lib/default.nix'
evaluating file '/nix/store/7jxnk6i5iqln519cpn4g9zf18fp8yn4y-nixpkgs-19.03pre169106.1a88aa9e0cd/nixpkgs/lib/fixed-points.nix'
evaluating file '/nix/store/7jxnk6i5iqln519
@J-Swift
J-Swift / .bash_aliases
Last active April 10, 2022 21:04
Helper to batch convert redump psx bin/cue to chd
function _do_next_chd_print_header() {
local -r text="${1}"
echo
echo '################################################################################'
echo "# ${text}"
echo '################################################################################'
echo
}
@J-Swift
J-Swift / thegamesdb.yaml
Last active January 9, 2020 03:14
Cleaned up swagger spec for thegamesdb
swagger: '2.0'
info:
description: API Documentation
version: 2.0.0
title: TheGamesDB API
license:
name: GNU General Public License v3.0
url: https://github.com/TheGamesDB/TheGamesDBv2/blob/master/LICENSE
# tags are used for organizing operations