- Jim Weirich: The Building Blocks of Modularity – http://goo.gl/g4Nk
- Jim Weirich: SOLID Ruby – http://goo.gl/z3jd
- Sandi Metz: SOLID Object-Oriented Design – http://goo.gl/PDn6T
- Sandi Metz: Less – The Path to Better Design – http://goo.gl/VuTl4
- Demeter is for Encapsulation – http://is.gd/eeyLx
- Opinionated Modular Code – http://is.gd/eeyXm
- Scaling to Hundreds of Millions of Requests – http://vimeo.com/12814529
- Confident Code – http://goo.gl/VFLX
- Destroy All Software Screencasts – https://www.destroyallsoftware.com/screencasts
- Corey Haines: Fast Rails Tests – http://goo.gl/Va2gb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArrayFlattener | |
# ArrayFlattener provides a method to flat nested array. | |
# For example, it can turn an array like [1, 2 [3, 4]] to [1, 2, 3, 4] | |
# Class method that can be called on ArrayFlattener that will convert nested array into flat array | |
def self.flatten(nested_array) | |
return [] if nested_array.length == 0 | |
self._flatten(nested_array, []) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'distance_calculator' | |
require 'json' | |
class CustomersInvitation | |
# CustomersInvitation provides methods to invite customers from a given list of customers | |
# which are x kms away from provided base location's coordinates. | |
attr_accessor :customers, :invited_customers, :base_latitude, :base_longitude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function largestRange(array) { | |
if (array.length === 1) { | |
return [array[0], array[0]]; | |
} | |
var hash = {}; | |
hash[array[0]] = []; | |
var current = array[0]; | |
for (var i = 1; i < array.length; i++) { | |
var temp = array[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let profit = 0; | |
let profits = {}; | |
function maxProfitWithKTransactions(prices, k) { | |
// Write your code here. | |
profit = 0; | |
mainProfit = 0; | |
profits = {}; | |
let max = 0; | |
for (let i = 0; i < prices.length; i++) { | |
process(prices, i, max, k, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div class="first"> | |
<div class="top first-color"></div> | |
<div class="right first-color"></div> | |
</div> | |
<div class="second"> | |
<div class="top second-color"></div> | |
<div class="right second-color"></div> | |
</div> | |
</div> |