Skip to content

Instantly share code, notes, and snippets.

# Set up kubectl aliases
if command -v kubectl 1>/dev/null 2>&1; then
eval "source <(kubectl completion bash)"
alias kgnsi='k config set-context --current --namespace=$(kg ns -o json | jq -r ".items[].metadata.name"| fzf)'
test -e "${HOME}/.kubectl_aliases" && source "${HOME}/.kubectl_aliases"
fi
# Check secrets resources
if command -v kubectl 1>/dev/null 2>&1; then
function kdecsec() {

Keybase proof

I hereby claim:

  • I am irmiller22 on github.
  • I am irmiller22 (https://keybase.io/irmiller22) on keybase.
  • I have a public key ASBdnUCb8cI2VfxcL7see4tKrVU_8QnnIoBUm0F6nJhkcwo

To claim this, I am signing this object:

@irmiller22
irmiller22 / interview_prep.md
Last active March 20, 2018 04:37
FS-BK Interview Prep

Data Structure Basics

Array

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
  • They are one of the oldest, most commonly used data structures.

What you need to know:

@irmiller22
irmiller22 / greed_score_method
Created December 6, 2013 19:16
Greed Score Logic
# GREED GAME
def score(dice)
return 0 if dice == nil
score = 0
counts = [0,0,0,0,0,0]
dice.each { |roll| counts[roll-1] += 1 if (1..6) === roll }
@irmiller22
irmiller22 / gist:7418546
Created November 11, 2013 19:06
Database Checklist
does it change the database?
where am I going to store that data?
what data needs to be stored?
name
the songs on the mixtape
- write my migration
how does that effect my models?
@irmiller22
irmiller22 / config.ru
Created October 21, 2013 14:22
hello_rack
# require 'Rack'
# class YourAppClass
# def call(env)
# [200, {'Content-Type' => 'text/html'}, ['Hello Rack!']]
# end
# end
# run YourAppClass.new
@irmiller22
irmiller22 / factorial.rb
Created October 16, 2013 03:45
factorial
def factorial(num)
if num <= 1
1
else
num * factorial(num-1)
end
end
@irmiller22
irmiller22 / serialize.rb
Last active December 25, 2015 15:49
serialize.rb
class Song
attr_accessor :title, :artist
def serialize
file_name = self.title.gsub(" ", "_").downcase
File.open("#{file_name}.txt", "w+") do |f|
f << "#{self.artist.name} - #{self.title}"
end
end
@irmiller22
irmiller22 / tap.rb
Created October 15, 2013 14:15
tap_method
class Dog
attr_accessor :name, :food, :breed
def bark
"Woof!"
end
def self.bark
"Awoo!"
end
@irmiller22
irmiller22 / version_sort.rb
Created October 13, 2013 19:46
version_sort_filenames
class Array
def version_sort
self.sort_by do |file|
file.scan(/\d+|[a-z]*/).map {|e1| e1.to_i}
end
end
end
filenames = [
"foo-1.10.2.ext",
"foo-1.11.ext",