Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
install: --no-document # See http://guides.rubygems.org/command-reference/#gem-install | |
update: --no-document # See http://guides.rubygems.org/command-reference/#gem-update | |
:backtrace: true |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
Setting this up took quite a bit of time and research for me, so just thought of sharing the learnings along the way that led to a working setup.
Initial error that I was getting with running System tests in Rails 6
System test integration requires Rails >= 5.1 and has a hard dependency on a webserver and `capybara`, please add capybara to your Gemfile and configure a webserver (e.g. `Capybara.server = :webrick`) before attempting to use system tests.
Capybara
in the Gemfile, a part of my Gemfile looked like below:let currentColor = '#ebedf0'; | |
let clicking = false; | |
const boxes = document.querySelectorAll('.js-calendar-graph-svg rect'); | |
const graph = document.querySelector('.js-calendar-graph-svg'); | |
// code for switching the current color | |
function handleColorChange(e) { | |
const el = e.currentTarget; | |
currentColor = el.style['background-color']; | |
console.log(currentColor) |
// init | |
let xhr = new XMLHttpRequest() | |
let domain = 'https://read.amazon.com/' | |
let items = [] | |
let csvData = "" | |
// function | |
function getItemsList(paginationToken = null) { | |
let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50' | |
xhr.open('GET', url, false) |
# I have lots of projects. As I do the rails upgrades I collect the pin changes and other adjustments here | |
# towards the end of upgrading all the projects it gets easier and easier because of these commands. | |
❯ ./rails-upgrade | |
Commands: | |
rails-upgrade apple_touch # add blank apple-touch icons | |
rails-upgrade application_record # adds ApplicationRecord and replaces all references to ActiveRecord::Base with it | |
rails-upgrade asset_precompile_check # look for assets that need to be added to the assets initializer precompile list | |
rails-upgrade assigns_check # the assigns method has been extracted to a gem, check if it is used, and add the gem | |
rails-upgrade before_filter # change before_filter to before_action in controllers |