Jesse Farber

SOFTWARE DEVELOPER


Jesse Farber brings his award-winning creative talents and passion for detail to his full-stack software and web development, producing elegant solutions with innovative design.

Code Snippets


Luhn Algorithm

This Ruby program checks a number with the Luhn algorithm, a method for determining valid and invalid numbers for credit cards and other identification purposes. It is meant to prevent users from accidental errors.

module Luhn
  def self.is_valid?(number)
    revnumber = number.to_s.reverse
    split_revnumber = revnumber.split('').map { |digit| digit.to_i }
    split_revnumber.length.times do |n|
      if n.odd?
        split_revnumber[n] *= 2
        if split_revnumber[n] > 9
          split_revnumber[n] -= 9
        end
      end
    end 
    digit_sum = split_revnumber.inject(0){|sum,x| sum + x }
    if digit_sum % 10 == 0
      puts true
    else 
      puts false
    end
  end
end

Luhn.is_valid?(4194560385008504)

Recursive and Iterative Fibonacci Sequences

This Ruby program provides two different methods to find the Fibonacci sequence value for a particular number: one recursive solution, and one iterative solution. It also uses Ruby's Benchmark module to show which method finds the value more efficiently.

class Fib_sequence
  def recursive_fib(n)
    if n < 2
      n
    else
      recursive_fib(n - 1) + recursive_fib(n - 2)
    end
  end

  def iterative_fib(num)
    fib_numbers = [0, 1]
    (1..num).each do |n|
      if n < 2
        fib_numbers[n] = n
      else 
        fib_numbers[n] = fib_numbers[n - 1] + fib_numbers[n - 2]
        n += 1
      end   
    end
    fib_numbers.last
  end
end

f = Fib_sequence.new

num = 35
puts f.recursive_fib(num)
puts f.iterative_fib(num)

Benchmark.bm do |x|
  x.report("recursive_fib") { f.recursive_fib(num) }
  x.report("iterative_fib") { f.iterative_fib(num) }
end

Linked Lists

This Ruby program provides methods for working with a linked list data structure, including building the list and printing the series of values, reversing the node sequence, and using the Floyd's Cycle Detection Algorithm (aka Tortoise and Hare) to check whether the list contains a loop.

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)
  if list_node
    print "#{list_node.value} --> "
    print_values(list_node.next_node)
  else
    print "nil\n"
    return
  end
end

def reverse_list(list, previous=nil)
  while list
    new_list = LinkedListNode.new(list.value, previous)
    list = list.next_node
    previous = new_list
  end
  list = new_list
end

def jump_two_spaces(h)
  h = h.next_node.next_node
end

def jump_one_space(t)
  t = t.next_node
end

def has_infinite_loop?(list)
  tortoise = hare = list
  while hare && hare.next_node
    hare = hare.next_node.next_node
    tortoise = tortoise.next_node
    return true if hare == tortoise
  end
  return false
end

Web Apps


Quote Generator

A database-powered quote generator with a mobile-first design, using the Ruby on Rails framework, HTML, and CSS. Uses Git and GitHub for version control, and launched on Heroku.

Yelp Clone

A Yelp clone that integrates with the Google Maps API and includes features like user comments, star ratings, image uploading, and user authentication.


Two-Sided Market Place

A two-sided, video-streaming marketplace platform that features credit card payment capabilities, user role management, complex user interfaces, and advanced database relationships.

Test Driven Development

An Instagram clone that was built using industry-standard, test-driven development following numerous red/green/refactor cycles.


Single Page Todo Application

A single-page to-do application featuring a fluid user interface that uses JavaScript to allow users to rapidly add dynamic content.

Agile Team Project

A chess application built as part of an Agile software development team. Under the guidance of a senior software engineer, we had weekly Agile team meetings for code reviews, sprint planning, and feature assignments.




Skills & Tools


Jesse has developed proficiency and expertise in the following programming languages, and experience with the following tools.




Contact


Currently entertaining new opportunities. Please get in touch via email:

jesse@jessefarber.com