Skip to content

Instantly share code, notes, and snippets.

View nerboda's full-sized avatar

Eliathah Boda nerboda

View GitHub Profile
@nerboda
nerboda / secret_handshake.rb
Last active September 24, 2016 16:27
Weekly Challenge - Secret Handshake
# A SecretHandshake class that decodes binary commands in a secret language
class SecretHandshake
SECRETS = ['wink', 'double blink', 'close your eyes', 'jump'].freeze
def initialize(num)
@bits = to_binary(num).chars.reverse
end
def commands
secrets = @bits.map.with_index { |bit, idx| SECRETS[idx] if bit == '1' }
@nerboda
nerboda / pythagorean_triplet.rb
Last active September 26, 2016 02:53
Weekly Challenge - Pythagorean Triplet
# A class for auto-generating pythagorean triplets according to
# certain criteria, as well as testing whether a set of 3 numbers
# is a valid pythagorean triplet.
class Triplet
def initialize(*nums)
@nums = nums
end
def sum
@nums.reduce(:+)
@nerboda
nerboda / simple_cipher.rb
Last active September 26, 2016 20:21
Weekly Challenges - Simple Cipher
# A cipher for encoding and decoding strings of text
class Cipher
attr_reader :key
def initialize(key = nil)
raise ArgumentError, 'Invalid key' if invalid?(key)
@key = key || set_key
end
@nerboda
nerboda / simulator.rb
Last active September 26, 2016 23:39
Weekly Challenges - Robot Simulator
# Robots can: turn left, turn right, or advance
class Robot
attr_reader :bearing
def initialize
@bearing = :north
@x = 0
@y = 0
end
@nerboda
nerboda / minesweeper.rb
Last active September 27, 2016 20:21
Weekly Challenges - Minesweeper
# A custom error class for handling invalid minesweeper boards
class ValueError < StandardError; end
# Minesweeper Board
class Board
class << self
def transform(board)
raise ValueError, 'Invalid character' if invalid_char?(board)
raise ValueError, 'Unequal row lengths' if uneven_lengths?(board)
raise ValueError, 'Invalid border' if invalid_border?(board)
@nerboda
nerboda / hunt_the_wumpus_notes.md
Last active December 9, 2016 19:57
Some Thoughts about Building the Hunt the Wumpus Game with fellow Launch School Students

Thoughts on Hunt the Wumpus Development Process

A few months back Abhi, Eli and I decided to work together on a project. The objective of this project is to develop a text-based, Ruby version of a game called Hunt the Wumpus as a group exercise in order to explore what it would be like to work collaboratively on a programming project and to develop our team-working skills

Hunt the Wumpus is a classic game originally developed by Gregory Yob and was suggested by Chris as a good project for us to work on.

What we've ended up with a few months later is a working game, but with two versions of the code-base:

https://github.com/nerboda/ls-hunt-the-wumpus

@nerboda
nerboda / what_should_we_build.md
Last active February 9, 2017 21:08
What should we build?

What should we build?

Rather than just picking an idea and jumping right into writing code, we think it's a good idea to spend some extra time up front to explore several different ideas, compare them, and choose the one that ranks best based on the following factors:

  • Will the project be useful to at least a small niche of other developers?
  • Can we get to an MVP within a reasonable amount of time (maybe a month?) with the limited amount of time we each have available per week
  • Is there room for continued growth of the project once we reach an MVP?
  • Do the technical steps involved in building the project rely mostly on things we've already learned (thus allowing us to practice and improve our efficiency with our current skillset), while also offering a good challenge for each of us to learn a few new things?
    • These new things could be: more advanced features of the Ruby language, more advanced OO design concepts, or even just having to dig into the documentation for other libraries
  • And
@nerboda
nerboda / radial-blog-feature.md
Last active March 18, 2017 18:55
Radial Blog Feature

Tell us a little about your background.

I was an SEO guy when I started dabbling in web development. The digital marketing company I worked for did a bit of design and development as well and I always found myself trying to sneak into projects that required me to write code. It was all front end stuff at this point: HTML, CSS, a little jQuery. I was terrible at it of course, but it was way more fun than keyword research or link outreach.

I kept looking for practical ways of practicing my new hobby, and because I worked with spreadsheets so often, I started writing Ruby scripts to automate all the repetitive tasks I dreaded doing manually. Eventually, I started digging into Rails so I could build some ridiculous app ideas I had that were clearly never going to go anywhere. They didn't, but I learned a lot and eventually decided I wanted to leave the digital marketing world and be a developer.

Lots of books, tutorials, blood sweat and tears later, I landed an internship with this pretty cool little compan

@nerboda
nerboda / flattenAndUnique.js
Created November 2, 2017 16:02
Flatten And Unique
function isStringNumber(input) {
return !!(typeof input === 'string' && input.match(/^\d+$/));
}
function includes(array, search) {
return array.some(function(element) {
if (typeof search === 'number' || isStringNumber(search)) {
return search == element;
} else {
return search === element;
@nerboda
nerboda / osha_city_sites.html
Created November 30, 2017 00:37
Mobile Friendly Styles for OSHA City Sites
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-38847374-13', 'auto');
ga('send', 'pageview');
</script>