Skip to content

Instantly share code, notes, and snippets.

View notjames's full-sized avatar
💭
¯\_(ツ)_/¯

Jim Conner notjames

💭
¯\_(ツ)_/¯
View GitHub Profile
@notjames
notjames / shell-set.sh
Created June 23, 2020 03:14 — forked from kigster/shell-set.sh
BASH functions to read values of set -e, -x, etc and be able to save them, and restore them later, eg. at the end of a function that wants to handle its errors.
#!/usr/bin/env bash
# ———————————————————————————————————————————————————————
# BashMatic Utilities Library
# ———————————————————————————————————————————————————————
# © 2017-2020 Konstantin Gredeskoul, All rights reserved.
#
# Distributed under the MIT LICENSE.
#
# Sources: https://github.com/kigster/bashmatic
# ———————————————————————————————————————————————————————
@notjames
notjames / kubescan.sh
Last active April 2, 2018 20:51 — forked from samba/kubescan.sh
Dump cluster state to YAML
#!/bin/bash
# USAGE
# kubescan.sh [kubeconfig.yaml] > state.yaml
# Goal:
# - Provide a quick way to dump the state of a cluster for analysis
# - Simplify verification of live state of the cluster
KUBECONFIG=${1:-$KUBECONFIG}
@notjames
notjames / exercise.tour.go
Last active July 9, 2017 07:35 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@notjames
notjames / fullbeaker.md
Last active May 26, 2017 05:13 — forked from mark665/fullbeaker.md
Full Beaker "Homework"

1. The table below shows the formulas for triangular, pentagonal, and hexagonal numbers.

... ... ...
Triangular Tn = n(n+1)/2 1, 3, 6, 10, 15, ...
Pentagonal Pn = n(3n-1)/2 1, 5, 12, 22, 35, ...
Hexagonal Hn = n(2n-1) 1, 6, 15, 28, 45, ...

The number T285 = P165 = H143 = 40755 is a triangular number, a pentagonal number, and a hexagonal number. Write code to find the next number like this.