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:

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

This is in response to your question about initializing a new instance of a class, and correspondingly passing in parameters that are initialized with the class. Let's take an example below:

class Person
  def initialize(name)
    @name = name
  end
end
@irmiller22
irmiller22 / forms.md
Last active August 29, 2015 14:03
Rails Forms

Form_for

  • Most magical form helper in rails
  • form_for is a ruby method into which a ruby object is passed
  • form_for yields a form builder object (typically f)
  • methods to create form controls are called on f, the form builder element
  • when the object is passed as a form_for parameter, it creates corresponding inputs with each of the attributes
    • if i had form_for(@cat), then the form field params would look like cat[name], cat[color], etc
  • in keeping with Rails convention regarding RESTful routes, there should be a resource declared for each model object (eg, resources :cats)
@irmiller22
irmiller22 / kickstarter.rb
Created February 23, 2014 21:41
Kickstarter_scrape
# Kickstarter Project Scrape
require 'nokogiri'
# HTML, XML parser that allows us to view HTML code as series of nodes; able to highlight elements via CSS selectors
require 'open-uri'
# Module that allows you to make http request, and returns us the HTML content of a URL via the `open` command
require 'pry'
# projects
# kickstarter.css("li.project.grid_4")
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@irmiller22
irmiller22 / rspec_rails_env.md
Last active August 29, 2015 13:56
RSpec Testing for Rails

Setting up RSpec-Rails

Generate RSpec testing

rails g rspec:install

config/applications.rb

config.generators do |g| g.test_framework :rspec, fixtures: true,

@irmiller22
irmiller22 / flatiron_scrape.rb
Created February 16, 2014 22:37
Flatiron Scraper
require 'nokogiri'
require 'open-uri'
require 'pry'
class Scraper
def initialize
@student_data = []
@index_url = "http://students.flatironschool.com/"
@index = Nokogiri::HTML(open(@index_url))