- miracle
- solution for house
- setup sparring stuff
- exercism group
This file contains hidden or 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
| (define tests | |
| '((eq? 5 (+ 2 3)) | |
| (eq? 5 (+ 3 3)))) | |
| (define (test-iter test-list results) | |
| (cond | |
| ((null? test-list) results) | |
| (else | |
| (test-iter | |
| (cdr test-list) |
Challenge 1: Refactor starting from here to pattern matching/ strategy pattern so that neither Bottles nor Verse would need to be altered in order to replace verse 6 with lyrics regarding 6 packs. (Sample in the comments below. Any language of your choice as always.)
Challenge 2: Start thinking about a world where you can write 6.to_bottle. (Or however you would create a bottle number primitive in your language of choice.) I recommend against attempting to hand-crank your way there.
class Bottles
def sing
This file contains hidden or 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
| // RE: https://twitter.com/j3/status/448686275751469056 | |
| function DNA(sequence){ | |
| "use strict"; | |
| var displayedMarkers = ['A', 'T', 'C', 'G']; | |
| var acceptedMarkers = displayedMarkers + ['U']; | |
This file contains hidden or 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 stripCommas(input) { | |
| return input.replace(/,/, ''); | |
| } | |
| function ExpenseForm($el) { | |
| $el.on('submit', clean) | |
| function clean() { | |
| $el.find('input[type=text]').each(function (index, field) { | |
| field.value = stripCommas(field.value); |
The problem: Active Record objects have built in serialization (to_json), but I want to use vanilla objects wherever possible.
My solution:
class Report
attr_reader :data, :group_reports
def initialize(data)
@data = data
@group_reports = (data.weekly_group_reports + [data.weekly_used_report]).map { |group_report|
This file contains hidden or 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 class="large-6 columns" ng-controller="metricCtrl"> | |
| <select ng-model="selected['metric']" ng-options="m.name for m in metrics"></select> | |
| <table> | |
| <thead> | |
| <tr> | |
| <th>Dealership</th> | |
| <th ng-repeat="metric in metrics" class="{{ activeClass(metric, selected) }}">{{ metric.name }}</th> | |
| </tr> | |
| </thead> | |
| <tbody> |
- good code
- steps of the walkthrough
- javascript concepts