Red-Green-Refactoring with Ruby Warrior
I'm placing all my solutions in this Gist. Unfortunately, I cannot monkeypatch or mix commands for better refactoring. It's the nature of the game that I must maintain control of the Player object only.
| <div ng-app ng-controller="Controller"> | |
| <input ng-model="myCheck" type="checkbox" /> | |
| <input ng-show="myCheck" type="text"> | |
| </div> |
| def open_screen(screen, args={}) | |
| screen = screen.new if screen.respond_to?(:new) | |
| self.home_screen = screen | |
| self.window ||= self.ui_window.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
| self.window.rootViewController = (screen.navigationController || screen) | |
| splash_fade = args.respond_to?(:splash_fade) |
| class RootController < UIViewController | |
| def viewDidLoad | |
| super | |
| @my_web_view = UIWebView.alloc.initWithFrame(view.bounds) | |
| @my_web_view.delegate = self | |
| @my_web_view.scalesPageToFit = FALSE | |
| view.addSubview(@my_web_view) |
I'm placing all my solutions in this Gist. Unfortunately, I cannot monkeypatch or mix commands for better refactoring. It's the nature of the game that I must maintain control of the Player object only.
Here's a simple gist of my Code Combat solutions. May it be useful to anyone who is teaching, playing, or learning Javascript.
| class FamilyConnectCell < UITableViewCell | |
| def rmq_build | |
| rmq(self.contentView).tap do |q| | |
| # Add your subviews, init stuff here | |
| # @foo = q.append(UILabel, :foo).get | |
| # | |
| # Or use the built-in table cell controls, if you don't use | |
| # these, they won't exist at runtime | |
| # q.build(self.imageView, :cell_image) |
| def tableView(table_view, cellForRowAtIndexPath: index_path) | |
| data_row = @data[index_path.row] | |
| #cell = table_view.dequeueReusableCellWithIdentifier(ALERTS_CELL_ID) || begin | |
| # rmq.create(AlertsCell, :alerts_cell, reuse_identifier: ALERTS_CELL_ID).get | |
| #end | |
| cell ||= AlertsCell.alloc.initWithStyle(UITableViewCellStyleSubtitle, reuseIdentifier:ALERTS_CELL_ID).autorelease | |
| cell = rmq.build(cell, :alerts_cell).get |
| # Validation Growth Plan | |
| # STEP 1: Validation Tool/Utility | |
| # STEP 2: Check on Validity of RMQ selected | |
| # STEP 3?: Place validation on a specific input, that will watch and validate onchange | |
| # The following a is a suggested workflow for Step 2 | |
| # Example project validation method |
| require 'date' | |
| require 'koala' | |
| class BirthdayLiker | |
| FACEBOOK_TOKEN = 'your_oauth_key' | |
| BIRTHDAY_WORDS = %w(birthday bday birfday birth born hbd) | |
| THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!', 'Danke!', ':)'] | |
| DATE_TIME_FORMAT = '%Y-%m-%d' | |
| def initialize(birthdate, opts={}) |
| class MainActivity < Android::App::Activity | |
| def onCreate(savedInstanceState) | |
| super | |
| seekBar = Android::Widget::SeekBar.new(self) | |
| seekBar.setMax(200) | |
| seekBar.setProgress(100) | |
| textView = Android::Widget::TextView.new(self) |