Date, DateTime, Time, and Timezones in Ruby & Ruby on Rails Helpful methods and explanations of how timezones behave for Ruby and Ruby on Rails Date & Time methods
Don't sell out Sometimes, abiding by your values and principles comes at a cost. This applies to both our personal lives and our business endeavours. I was thinking about this today as I was considering running some social media ads and pondering the types of ads I should run. There are different types
TypeError: Module specifier, 'application' does not start with "/", "./", or "../". (Rails 7+) I was running into this error for some iOS devices in my Rails 7 application. TypeError: Module specifier, 'application' does not start with "/", "./", or "../". This error occurs because import maps is not supported in legacy browsers, specifically in my situation where I
Ruby indenting in Neovim One annoyance I had to work through when I started using Neovim was an auto-indenting issue for Ruby code. Whenever I would write a method, the first line inside the method that should be indented one step in would be auto-indented to align with the previous line as soon as
I had been using Turbo Frames wrong "It’s good practice to start your interaction design without Turbo Streams." That is a verbatim quote from the Turbo Handbook. The full quote reads: "It’s good practice to start your interaction design without Turbo Streams. Make the entire application work as it would if Turbo
Smartphones: Finding the best of bad options The iPhone has long been my go-to smartphone. When you use a Mac, an Apple TV, HomePods, and have other Apple devices like AirPods, you simply can't beat the seamless user experience that Apple provides. Apple has also staked part of their reputation in being a better option
Turbo Frames and JS form.submit() There is an issue with Turbo Frames and .submit() which causes it not to work with Turbo Frames. According to this Hotwire discussion: Turbo intercepts form submission events, but weirdly, the JS formElement.submit() method does not trigger the submit event. Solution Update to the latest version of Turbo and
Turn off Solargraph (and RuboCop) linting in Neovim It took me a bit to figure this one out. I wanted Solargraph LSP in Neovim for the go-to definition and references but I didn't want the live linting in-editor. I'm happy to run RuboCop but at the time I didn't want its notices
Text messaging needs to be a key part of your church's communications 95% of text message are opened and read within 3 minutes. That's an astounding stat. Especially when you compare that with the average email open rates of around 20-25%. That means that for every 100 people you message, 70 more people will open your message if it'
High dosage vitamin C for cold and flu The below are my documented notes on high dosage vitamin C treatment for cold and flu. This should go without saying that this is not advice for other people but documentation of my own experience and my family's own experience so far. We are doing what we can
Good customer service is becoming more valuable More and more often, poor customer service seems to be the norm. I purchased a new washer and dryer two days ago on costco.ca. Everything went through and payment was processed. Then out of nowhere I receive an email last night saying that the order was cancelled. Reason: out
World Cup: thoughts after the Round of 16 Brazil & Croatia Brazil look good but I kind of think they haven’t faced a real challenge yet. They should beat Croatia but I’ll be really interested to see what happens if they meet Portugal in the semi-finals. Croatia didn’t look very good in their last game
Browser & OS password managers encourage poor password habits On the surface, built-in password managers like Chrome's password management or Apple's Keychain provide a useful service. They make things more convenient for users to create different passwords for different services and make it easier to not have to repeat insecure passwords over and over. Yet,
Rebuilding Kipos & learning online marketing Kipos was one of the first applications I built with Ruby on Rails. The app allows you to view your upcoming bill payments and paycheques, check off that you have paid them, and view a forecast of your future account balance based on your upcoming cash flow and your current
Change Ruby version with RBENV Check versions installed on your machine: rbenv versions Install a specific version to your machine: (replace 3.1.2 with the version you want to install) rbenv install 3.1.2 Install the latest stable version of Ruby: rbenv install -l Set the Ruby version of a specific application by
Mix: Long Game Learning, Atmospheric Pressure, Bitcoin Long game learning It took around two and a half years from the time I started learning to code to the day I was able to switch my career 100% to web and software development. There are plenty of stories of people who have made that journey in a quicker
Server is already running From your project directory: cat tmp/pids/server.pid (or project_path/tmp/pids/server.pid if not in project directory) This will return a port number. kill -9 port_number (insert port number from above) Unsafe way if the above doesn't work connection to server at "
Edit Rails Credentials You can edit your Rails credentials file using the nano editor in Terminal using the following command.
Mix: International Space Station, Real Estate, Bitcoin The International Space Station is only 408km from the surface of the earth. That is less than four hours of highway driving in terms of distance.
Open links in a new tab for Ghost Ghost currently doesn't provide the option to set a link to open in a new tab. So in order to do this, a little bit of Javascript is needed. Here is the code snippet that can be added to your site. To do so, visit the Code Injection
Edit Rails credentials with RubyMine on Mac You can use RubyMine to edit your Rails credentials file on Mac with the following command: EDITOR="/Applications/RubyMine.app/Contents/MacOS/rubymine --wait" rails credentials:edit This will open the file for editing in RubyMine and wait until the file is saved before saving and encrypting the
Measuring elapsed time with Ruby Over the weekend I was working on a side project and I found myself needing to improve the speed of certain methods, so looked up some ways to measure time in Ruby for this purpose. Several posts gave the obvious answer - set a start_time variable at start, set
Goodbye WordPress, Hello Ghost The time to say goodbye to WordPress is here. I've migrated my blog to Ghost. Even though WordPress was the start of my journey into web development and programming, I can't really say I'm sad to be writing this. I don't feel
Customizing Gmail's appearance to make it less busy I don’t use Gmail for personal email and switched to Fastmail a couple years ago with a custom domain. I very much dislike Google’s invasiveness and don’t want them scanning my personal email. However, when it comes to business tools, there’s not much else that provides
Rbenv Unable to Change Ruby Version on Mac OS I’ve run into this issue on two different Mac machines now so I figured I would document the solution if it comes up again or if it comes up for someone else. Basically – you can’t get your terminal to use the Ruby version that you want. You run
Simple Pagination Concern for Ruby on Rails This is a reusable pagination concern that provides a simple solution for pagination in a Ruby on Rails application. Some of the code comes from Jonathan Allard who originally shared it here. However, I came across issues with the original code when specifying which page should be displayed. Rails would
Why I stopped using Roam Research, started again a year later, and then stopped again tl;dr: I was using Roam Research a lot, which actually became a problem because I didn't trust all of my personal notes in the cloud. Then Roam released their encrypted graphs, which made me feel more comfortable, so I started using them again. But now the product
Crypto & Bitcoin Wallets Cannot Be Frozen I'm feeling quite suspicious about all these reports coming out right now stating that crypto and bitcoin wallets are being frozen. It comes across as very deceptive. With the way these things are being reported, it makes me wonder if they’re purposely attempting to delegitimize crypto. If
Spin up a new Rails 7 Tailwind app with the app generator TL;DR: spin up a new rails app with Tailwind with this command: rails new app --css tailwind I don’t know about you but I feel like my life would be just a tiny bit better if I didn’t ever have to ever work with CSS – which is
Use Base Controller In a Rails app, when dealing with controllers that live within the same directory, we can create a base controller that those controllers can inherit from. This approach allows us to keep our code DRY and clean. controllers/ application_controller.rb admin/ base_controller.rb posts_controller.rb comments_controller.
Weird Heroku Gotcha: JPG not JPEG I just deployed a change to Heroku where I added a .jpeg image and it broke the app. Apparently, you cannot use .jpeg extensions on Heroku – at least not using Rail’s <%= image_tag %>. I didn’t attempt to use an HTML <img> tag to see
Customize your VSCode font sizes To edit your VSCode settings, use COMMAND + P to open your command palette and search for settings.json. Open the file. Once open, you can customize VSCode by adding the lines listed below. General Sizing The ZoomLevel setting allows you to adjust the size of everything within the VSCode window.
Your Google Analytics Metrics May Not Be Accurate One of the reasons those annoying cookie notices are on so many websites now is because of analytics tools like Google Analytics that collect user data. Cookie notices really are not a positive user experience in any way. No one likes being interrupted by them. In addition to that, it
How to Add Super Admin to WordPress Multi-site Network The simplest way to add a user as super admin is to have another super admin grant super admin privileges from WordPress dashboard. However, there may be times when this is not possible or is not convenient and you still need to add a super admin to your multi-site Another
Rails Hotwire First Impressions Finally had some time to dive into Rails Hotwire earlier this week and the process was so smooth. It really does feel like “new magic” and I cannot wait to get started on some new projects with this. However, apparently, Devise does not yet work out of the box with
Text messaging is a nuisance I came across this new service called texts.com over the weekend that looks promising. If it does what it says, I may not have to hate text messaging anymore. Text Messaging is really a nuisance. I don’t mean the people sending the messages, I mean the actual messaging
My new Household Assistant: Alfred I started working on a new personal project a few weekends ago that I am referring to as Alfred. The general concept of Alfred at this stage is that Alfred is a custom Household Assistant that is able to help keep track of various useful data points for around the
iOS 14.5 is more than just a software update As you may have heard, Apple just released a new update for iPhone and iPad, iOS 14.5. What makes this release more notable than most is that it includes a new feature called App Tracking Transparency. App Tracking Transparency requires an app to request permission from you in order
How to Edit Your Hosts File on Mac Follow the below instructions to update your hosts file on Mac. 1. Open Terminal 2. Type in the following command to open your host file in Terminal: sudo nano /etc/hosts You’ll then be asked for your user password, enter it. Terminal will open the nano editor and it
Avoid Spam Filters with Proper G Suite Email Configuration G Suite – Google’s all-in-one IT solution for businesses is a fantastic tool. It offers so much for such a reasonable price that it can get any small business up and running with email, calendar, Drive, docs, spreadsheets and much more. And not only that, but it’s quite simple
Accept Payments On Your Site Without a Heavy Shopping System Have you ever needed to accept payments on your site but don’t have a payment system built in? Today I’m going to walk through setting up Stripe Checkout on one of your webpages. What’s great about Stripe Checkout is that you don’t have to design anything,
Set up a WordPress site to require an invite code I recently built a website for a wedding and a specific feature they wanted was for the website only to be available to their guests. We didn’t want to have to deal with any cumbersome user login system, but just something simple that only invited guests would be able