Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You might not need jQuery

February 13, 2020 by Rob Bazinet Leave a Comment

Tweet

This is a really nice resource for those moving from jQuery to JavaScript ES6. I like the 1:1 comparisons.

jQuery and its cousins are great, and by all means use them if it makes it easier to develop your application.

If you’re developing a library on the other hand, please take a moment to consider if you actually need jQuery as a dependency. Maybe you can include a few lines of utility code, and forgo the requirement. If you’re only targeting more modern browsers, you might not need anything more than what the browser ships with.

 

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: JavaScript Tagged With: JavaScript, jQuery

10 Ruby on Rails Learning Resources for 2020

February 6, 2020 by Rob Bazinet Leave a Comment

Tweet

Even though Ruby on Rails has been around since 2004 as an open source project, I still get asked the best ways to learn the framework today.

It’s a fair question and answers do change as the Ruby on Rails landscape has evolved.

Beginner Level

You have little to no Ruby on Rails knowledge and are looking for resources to get you started out right.

  1. The Ruby on Rails Tutorial by Michael Hartl – now in it’s 6th edition and keeping up with Rails 6. This book and video options (20 hours) help many Rails developers get started. It’s written my Michael Hartl and comes in at 883 pages. It is a well-written tutorial.
  2. Ruby on Rails Guides – when talking about getting information from the source, this is the one to use. Each section contains the documentation on all the major parts of the Ruby on Rails framework broken up by function. A nice feature is users can select the version they are using, starting with the latest as of this writing, 6.0.2.1 all the way back to 2.3.
  3. Agile Web Development with Rails 6 – the Rails 6 version of the book which has gotten many Rails developers started, including myself. The Pragmatic Bookshelf offers a version back to Rails 4 so make sure you reference the correct version. This version will help with coming up to speed on the new Action Mailbox and Action Text. It offers source code for the project, which is a nice eCommerce application with practical value.
  4. Agile Web Development with Rails 5.1 – this version of the book is, you guessed it, targeting Rails 5.1. It contains the latest updates for 5.1 and offers source code for the project, which is a nice eCommerce application with practical value.

Intermediate Level

You’ve built a couple applications, know the beginner material and have a couple years of Rails experience. You are ready to move on to hone your skills.

One of the-best ways to learn, for me and I’m sure others, is by watching screencasts. The next two resources are they best out there.

  1. Go Rails Screencasts – created by Chris Oliver who is a great contributor to the community. At the time of this writing Chris is up to 330 videos of varying length (~5 min to ~30 min) covering a wide breath of topics, including everything from Rails concepts to the inevitable problem you’ll face when creating Rails applications. There is also a forum that accompanies the videos were you can ask questions or answer some if you so choose. There are some free videos and a Pro plan you can pay for to get the rest of the videos for a reasonable monthly fee. It’s a bargain for sure.
  2. Drifting Ruby Screencasts – created by Dave Kimura, also a long-time Rails developer. Dave is currently up to 227 episodes with episodes running from ~10 min to ~30 min. You might think these screencasts are probably like those from Go Rails, hardly. I think they complement each other very well. Even for topics they are the same, I find the approaches very different. There are also free episodes and others are paid for with a small monthly fee.
  3. Modern Front-End Development for Rails – when moving to recent versions of Rails, 5.1+, you have exposure to technologies such as JavaScript with the required tooling. This book takes you there and helps clear up some of the confusion that will certainly arise.

Advanced Level

You feel good about your Ruby on Rails skills and want to press on to even more advanced topics.

  1. Metaprogramming Ruby 2 – if you aren’t sure what metaprogramming is, it’s worth learning about and use it where it makes sense. It’s a technique that’s used in Rails and other Ruby frameworks and applications. It’s powerful. This book is the best resource I’ve found on the subject from just learning it to becoming proficient.
  2. Rails 5 Test Prescriptions – the Rails community is all about Test-Driven Development (TDD) and this book gives great coverage of the subject. It covers RSpec and mintiest. RSpec is probably the most popular testing tool for Rails. Mintiest is the default testing framework.
  3. Docker for Rails Developers – unless you’re living under a rock you have at least heard of Docker. This book is the only source I am aware of that directly helps Rails developers containerize their application. It is a great single source.

If you’re just starting out, a seasoned expert or somewhere in between. I think these are some of the best sources of guidance and knowledge available for our beloved Ruby on Rails.

If you think I forgot something, please leave a comment and let me know.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: Ruby on Rails

Computer Science Education in the Past to the Present

April 26, 2019 by Rob Bazinet Leave a Comment

Tweet

A quick but thought-provoking post from Fred Wilson about CS education in our K12 system.

As many of you know, I have spent a fair bit of my time over the last ten years on increasing the amount of CS Education in our K12 system in NYC and around the US.

My friend Rob sent me this short (2 1/2 min) clip of John von Neumann in the early 50s talking about how important CS Education and in particular K12 CS Education would be.

We largely ignored his advice for the last sixty years but I am optimistic that we are finally heeding it.

This video from the 1950’s shows John von Neumann talking with a young man about his future. This young man is considering being an attorney. Computer Science in those early days was virtually non-existent except in very small circles.

Fast forward to 1983 when I was in High School and was one of about a dozen students who had access to the only TRS-80 (with a cassette drive) in our school system. We were our own CS education. There were no classes to learn to program at that time. It was only a couple years later that the first BASIC programming courses appeared.

Continuing forward to 2018 where my daughter was a senior at the same High School I attended. The computer science program was certainly expanded but I don’t think it had a large focus. I can’t explain why, maybe the administration couldn’t find adequate teachers or probably more accurately, the administration felt there were other priorities.

This High School even has gotten into eSports, where students get credits for playing video games.

I agree that CS education has gotten better, but it needs to get a lot better. K-12 today is the incubation channels for our kids and their future. I think it starts with early education to stimulate the minds of kinds to be creators. Creators with technology and the capabilities of the tech but what is possible for the future. The future they can build, with their minds.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Technology Tagged With: computer science

This Wisdom of Joe Armstrong Will Live On

April 24, 2019 by Rob Bazinet Leave a Comment

Tweet

I found out about the death of Joe Armstrong, the father of Erlang, recently as did the world.

It is with great sadness that I share news of Joe Armstrong’s passing away earlier today. Whilst he may no longer be with us, his work has laid the foundation which will be used by generations to come. RIP @joeerl, thank you for inspiring us all.

— Francesco Cesarini (@FrancescoC)

April 20, 2019

It saddens me that I never had the opportunity to meet him. I did find this very interesting and applicable quote to all developers. We can take guidance.

Spf13 2019 Apr 23

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming Tagged With: erlang

Fixing TextExpander on macOS 10.14

April 12, 2019 by Rob Bazinet Leave a Comment

Tweet

I use TextExpander from Smile Software every day and rely on it for so many helpful snippets. After upgrading my iMac to macOS Mojave, I realized that TextExpander was broken and nothing I tried worked. It seems TextExpander would no longer expand any snippets. Trying the menu option to “Enable Expansion” did nothing.

I sent a support request to Smile and was really happy to have a response in the matter of an hour. Not surprising, I was not the only one with the issue:

Hi Rob,

Thank you for contacting Smile Support. I’m sorry to hear that you’re having trouble. A few users have reported something similar and these instructions should get it working again:

https://smilesoftware.com/blog/entry/textexpander-macos-10-14-mojave-and-accessibility

After you complete those steps it may also be necessary to click on the TextExpander icon in the menu bar and choose ‘Enable Expansion’. Please let me know if you continue to have trouble.

Maybe this will help someone else with the same problem.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: macOS, textexpander

When You Can’t Check a Checkbox using Capybara

December 5, 2018 by Rob Bazinet Leave a Comment

Tweet

In my last post I documented an issue I was having using Capybara on a client’s Ruby on Rails application with a ReactJS frontend.  I wanted to share another issue I came  across during my feature testing escapades.

The Problem

During my recent feature testing project I had a form which has a checkbox on it. The checkbox had a label with it. Did I mention this is a ReactJS frontend? I’m not sure if this is specific to ReactJS, but I suspect it isn’t. I think other frontend JavaScript frameworks may exhibit the same problem.

The Ruby code for my feature test is dead simple:

check “English”

That’s it. The test should run and when it finds the checkbox with a label of English, the checkbox should be checked. But, it doesn’t work. After many attempts at making this work and more Google searches than I can remember..I ended up at the Capybara mailing list.

The Solution

Thomas Walpole was kind enough to reply with his thoughts on the matter:

99.9% sure your checkbox isn’t actually visible on the screen.

What you’re describing as the “checkbox” is probably an image (probably added via CSS pseudo elements) being shown in place of the actual checkbox input element to ensure the same styling across different browsers.  If the checkbox has a label element correctly attached to it you can use `check(‘whatever’, allow_label_click: true)` – https://www.rubydoc.info/ github/jnicklas/capybara/ Capybara/Node/Actions#check- instance_method –  to tell Capybara to click the label element instead of the hidden checkbox input to toggle state.  If you don’t have an associated label then you’ll need to find whatever element is actually visible on the page and click it instead.

Changing my test to include this for the checkbox, worked perfectly.

check(“English", allow_label_click: true)

I hope someone finds this valuable and will save them some time and hair pulling.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: capybara, rspec, Ruby on Rails, tests

Fixing StaleElementReferenceError When Using Capybara

December 4, 2018 by Rob Bazinet Leave a Comment

Tweet

I’ve been spending an extended period of time lately writing Feature specs for a Ruby on Rails project using Capybara. Overall it’s been a fun project to work on but I had run into a few issues along the way. One in particular is the StaleElementReferenceError exception that get thrown when you are trying to find an element on your page that you know is there but Selenium can no longer find.

The error appears to be a timing issue between the page loaded in the browser, it being rendered and Capybara and Selenium trying to find the element. After much trial and error, along with many Google searches, I found no solutions that were reasonable. Even though many people had the same problem.

The solution was pretty simple actually. I added a rescue to my test and simply slept for 1 second and retry the failure. I admit, this seems like a hack but it works and that’s all I really cared about at the time. I see no ill effects from this, no measurable delay.

RSpec.feature "Listings", type: :feature, js: true do
  scenario "can edit common area - step 3" do
    begin
      post_a_space_step_1_with
      click_on 'Next'
      post_a_space_step_2_with
      click_on 'Next'
      click_on 'Edit Common Area'
      expect(page).to have_content "Step 1"
    rescue Selenium::WebDriver::Error::StaleElementReferenceError
      sleep 1
      retry
    end
  end
end

I’m certainly open to a better solution or an explanation as to why this might be bad. Please leave comments. Hopefully I help someone get around this really annoying problem.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: capybara, Ruby on Rails, selenium

Ruby on Rails Testing Resources

November 14, 2018 by Rob Bazinet Leave a Comment

Tweet

When taking the plunge into Ruby on Rails it’s really easy to get carried away with learning all about the framework. It’s easy to learn the fundamentals and later realize the Rails community is a community of testers. It’s a strange world when you set out to learn about testing, TDD (test-driven development), BDD (behavior-driven development) and other acronyms and phrases relating to testing Ruby on Rails applications.

I decided to put together a short list of helpful resources to get started. If you have suggestions that would be useful to be added to this list, please add a comment or email me directly and I’ll update this post.

Books

  • Everyday Rails Testing with RSpec – this is a great, hands-on, roll-up your sleeves and get-to-work book. If you want to use RSpec on a daily basis, this book gives great advice on how to use RSpec in your day-to-day routine. It’s kept up-to-date with latest RSpec too.
  • Rails 5 Test Prescriptions – I use this book as a reference I often go to. It’s been updated to from previous versions to now Rails 5 and is a great tool to have on the shelf.
  • Effective Testing with RSpec 3 – if you decide you’d rather start without worrying about all the details around Rails you can start with learning RSpec with plain Ruby and help yourself. I’ve been through this one cover-to-cover and it’s a great tutorial.
  • The Minitest Cookbook – if you decide RSpec isn’t for you, this is probably the ultimate resource for Minitest. Well-written and kept up-to-date.

Podcasts

You can’t really learn testing from a podcast but you can learn how others approach the craft. The first is a podcast dedicated to testing Ruby applications. The rest is a list of a few episodes of podcasts that discussed testing.

  • The Ruby Testing Podcast
  • Ruby Rogues 385: “Ruby/Rails Testing” with Jason Swett
  • Ruby Rogues 269 Testing
  • Full Stack Radio 46: Joe Ferris – Test Driven Rails

I’ve been listening to The Ruby Testing Podcast and picked up some nice tidbits so far.

Training

I love Pluralsight.

  • RSpec the Right Way
  • Test-driven Rails with RSpec, Capybara, and Cucumber

Xavier Shay has long been involved in the Ruby community and well-known for discussions around testing. One of his best blog posts explains his approach to testing.

  • Testing Ruby Applications with RSpec

I’ve taken several courses on Udemy and they are one of my favorite places for training. The prices are low and there are many courses, so you have to do a bit of work to see which course is right for you but well worth the effort.

  • The Complete TDD Course: Master Ruby Development with RSpec
  • Ruby on Rails 5 – BDD, RSpec and Capybara

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby on Rails Tagged With: bdd, minitest, rspec, Ruby on Rails, tdd, unit testing

Speeding up Slow Time Machine Backups on macOS

November 6, 2018 by Rob Bazinet Leave a Comment

Tweet

I’ve been a long-Time Apple Time Machine for many years and it’s saved me many times.

I back up to a Synology NAS drive configured with Time Machine support. Time Machine has always been fast and efficient until I upgraded to macOS El Capitan (10.11). During that time, backups could be measure in hours instead of minutes previously. I initially thought the slowdown had to do with a recent software change in my Synology NAS.

I spent a bit of time in the Synology forums trying to solve the problem with various suggestions from users. Nothing worked.

I upgrade to macOS Sierra (10.12) and High Sierra (10.13) when they came out, hoping something had changed that fixed the agonizingly slow backups. No luck.

Disabling Throttling

I recently started to try to find a solution again since my backups recently went up in size and the slowness was really noticeable. Estimated backup times measured in days. After a bit of digging I found this suggestion, entered in a Terminal window:

sudo sysctl debug.lowpri_throttle_enabled=0

It worked beautifully. A very large backup went from days to hours. Subsequent backups now take minutes instead of hours.

Note: you can re-enable throttling with a similar command:

sudo sysctl debug.lowpri_throttle_enabled=1

I admit I don’t know the side effects of disabling throttling, so use at your own risk.

Making it Stick

If you want to have throttling turned off between Mac restarts, you have to do a bit more work.

Create a file under /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist with the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>fix-el-capitan-slow-time-machine-speed</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/sbin/sysctl</string>
      <string>debug.lowpri_throttle_enabled=0</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

Make it belong to root:

sudo chown root /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist

Make it load at startup:

sudo launchctl load /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist

Conclusion

I’ve also tested on macOS Mojave (10.14.1) and can confirm a nice speedup. Overall, everything works really well now. I can’t take credit for the solution as I did some searching and came across several places this was mentioned, including one from Apple. I just know that it works!

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Mac Tagged With: macOS, Synology, Time Machine

Amazon.com Provides Some of the Worst Customer Service

July 5, 2018 by Rob Bazinet Leave a Comment

Tweet

The title says it all, Amazon.com provides some of the worst customer service. Just try to contact them and see for yourself. They are so big that they create their own rules and we have to live by them.

I placed an order last night and here is the email I received this morning:

I never contacted Amazon about unauthorized activity on my account.

When I called their Customer Service, they could provide no good explanation other than I placed an order for a higher dollar amount than usual and this was the way they ensured I was being protected.

This was for MY benefit. The order was cancelled, my account was locked and all of my payment methods removed. I think Amazon expects that I should be grateful for their astute attention to security.

It’s now up to me to change my password after 5 hours, add my payment accounts back in and recreate the order they deleted.

This is how Amazon treats customers. I’ve been placing thousands of dollars worth of orders for years with never a problem, until Amazon thinks I ordered something too high priced.

I’ve been contacted by the fraud department of my credit card companies before; some was valid fraud while others were my purchases. The process was simple, they sent a text or called me to verify the purchase. I like this feature, it’s saved me. Amazon saved nothing but added aggravation.

I’d love to have another place to order from for the items we need. Amazon is getting too big and we need other options. If we had real options, I would take my business elsewhere today. I know they wouldn’t care but if enough people did this, then they might.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Business Tagged With: amazon, Customer Service

« Previous Page
Next Page »

Recent Posts

  • Status Bar in iTerm2
  • Supporting Multiple SSH Keys on macOS
  • Using the Microsoft Ergonomic Keyboard on macOS
  • 10 Steps to Survive Working from Home
  • “Are you building a business or learning a stack?”

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • I unsubscribe from blogs that only show me a tiny part of the post and force me to visit the site.
    about 1 week ago
  • If anyone is looking for a seasoned .NET, C# and https://t.co/q7WzxhZnCZ developer, a good friend of mine has some… https://t.co/5DqXtCzySr
    about 2 weeks ago
  • Slack is down…2021 is looking up already.
    about 3 weeks ago
  • Subscribe to Locally Sourced by Noel Rappin by @noelrap https://t.co/yZnXfg2tU5
    about 1 month ago
  • So true! https://t.co/6axDZAHASZ
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.