Skip to content

Instantly share code, notes, and snippets.

View Brandongoodman615's full-sized avatar

Brandon Goodman Brandongoodman615

View GitHub Profile
@Brandongoodman615
Brandongoodman615 / csv_creator.rb
Created December 6, 2019 15:53
Generating CSV files from an API data
# Run this file to auto generate a csv file based on the data passed in the products
# variable. I created this based on an API call that I parsed in the format of an array
# of hashes like the example in order to quickly generate a csv file for uploading.
require "csv"
products = [{"sku"=>"sku001", "name"=>"Item 1", "dimensions"=>"1 x 1 x 1"},
{"sku"=>"sku002", "name"=>"Item 2", "dimensions"=>"2 x 2 x 2"},
{"sku"=>"sku003", "name"=>"Item 3", "dimensions"=>"3 x 3 x 3"},
{"sku"=>"sku004", "name"=>"Item 4", "dimensions"=>"4 x 4 x 4"}]

Keybase proof

I hereby claim:

  • I am brandongoodman615 on github.
  • I am bgoodman615 (https://keybase.io/bgoodman615) on keybase.
  • I have a public key ASBjoP9hfN54RgFF-WCCoTTgpVeE647xMpMuzVbTMeQ7eQo

To claim this, I am signing this object:

@Brandongoodman615
Brandongoodman615 / is_obstructed.rb
Last active July 16, 2018 17:59
is_obstructed? method
class Piece
attr_accessor :x, :y
def initialize(x, y) # Every instance of self.x or self.y will need to be self.x_coord or self.y_coord
@x = x
@y = y
end
# Need function to automoatically keep up with current pieces coords at all times.
def current_pieces_coords # Will need to reference the db of all the current coords.
@Brandongoodman615
Brandongoodman615 / oop_quiz.rb
Created June 22, 2018 22:27
Quiz #3 Build a class
class Bicycle
attr_accessor :brand, :weight
def initialize(brand, weight)
@brand = brand
@weight = weight
end
def output_bicycle
puts "#{@weight} lb, #{@brand} bicycle"
@Brandongoodman615
Brandongoodman615 / linked_list.rb
Last active June 21, 2018 03:26
Brandon Linked_List Solution
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
def print_values(list_node)