Skip to content

Instantly share code, notes, and snippets.

@jayrobin
jayrobin / automated-wordles.md
Last active January 14, 2022 21:10
Taking the fun out of Wordle

Taking the fun out of Wordle

Wordle is great and you should definitely play it. I play it and love it, but I'm also a lazy, lazy man. Sometimes I fire up Wordle and my brain isn't caffeinated enough to figure out five whole letters. So, like a typical engineer, I spent far too long over-engineering an automated solution.

Where's the word of the day coming from?

My first guess was to check the network tab, but there were no fetch requests in there. I'm happy to see how lightweight everything is though!

@jayrobin
jayrobin / fee-mortgage-calculator-feedback.md
Created January 10, 2022 19:52
Feedback for frontendeval mortgage-calculator solution

I just want to preface this feedback by saying you did a great job on this question, and your write-up was fantastic! The majority of the following feedback here is along the lines of "if you weren't under a time limit in an interview / you were in a dev role and submitting code that would go to production".

  • Good job using labels correctly associated with the inputs: this is critical for screen readers and other assistive technology!

  • I liked your approach to formatting the currency: this is a really tricky problem that has a bunch of different possible solutions (number/string formatting is a pretty popular interview theme too). Thankfully for the web JS added a utility to do the heavy lifting for us: Number.toLocaleString. You can call toLocaleString on a number and pass in a locale

@jayrobin
jayrobin / gmaps.js
Created September 11, 2014 16:40
Disabling features on a map
map = new google.maps.Map(document.getElementById("google_map"), mapOptions);
var styles = [
{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
}
];
@jayrobin
jayrobin / queue.rb
Last active August 29, 2015 14:04
Ruby implementation of queue
class Queue
def initialize(max_size=nil)
@max_size ||= Float::INFINITY
@store = []
end
def enqueue(item)
raise "The queue is full" if self.full?
@store << item
end

Week 8

  • Fetch Changes
  • Peer Pair 1
  • Peer Pair 1 Feedback
  • Peer Pair 2
  • Peer Pair 2 Feedback
  • Meta Feedback 7+ Times
  • Submit Work
  • Fetch Changes
  • Peer Pair 1
  • Peer Pair 1 Feedback
  • Peer Pair 2
  • Peer Pair 2 Feedback
  • Meta Feedback 7+ Times
  • Submit Work
@jayrobin
jayrobin / Numbers to english words
Last active August 29, 2015 13:57
Prompts for a number and outputs the same number in English
# convert a triplet (0-999) into english words representing the value
def triplet_to_words(triplet)
ones = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
teens = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
left_digit = triplet / 100
middle_digit = (triplet % 100) / 10
right_digit = triplet % 10