Skip to content

Instantly share code, notes, and snippets.

View nt591's full-sized avatar

Nikhil Thomas nt591

View GitHub Profile
class Board
attr_reader :board
PADDING_VAL = 10000
def initialize
# filler value so i dont need to check for nil
@board = Array.new(9) {|i| PADDING_VAL + i}
end
def render_cell(cell)
@nt591
nt591 / EventEmitter.js
Last active November 4, 2019 16:27
Writing a test EventEmitter for Arceo FE
class EventEmitter {
constructor() {
this.events = {}
}
// helper
hasEvent(event) {
return this.events.hasOwnProperty(event)
}

99 Bottles Chapter 4: Practicing Horizontal Refactoring

Github commits: https://github.com/nt591/99bottles-ch4/commits/master

Replacing Difference With Sameness

The first goal for horizontal refactoring is to identify the MOST ALIKE pieces of code (aka the smallest amount of difference to change). In this case, look at the case for 1 and else

What are the differences? First number (1 vs number-1, bottles vs bottles/container(), take it down vs take one down.

@nt591
nt591 / richhickey.md
Created July 1, 2016 01:03 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following: