Async ChartKick / How to lazily fetch chart data
I love gem 'chartkick' for building quick and simple charting. An optimization I found is to render charts when they... Read more
14 Jul 2024
I love gem 'chartkick' for building quick and simple charting. An optimization I found is to render charts when they... Read more
14 Jul 2024
In your view file <%= column_chart(async_traffic_forecast_path(resource, params[:id]), library: { legend: { position: 'top' }, scales: { 'y' => { "type"... Read more
10 Jul 2024
I love the gem render_async because it’s a simple tool to make your controller action thinner. I was recently considering... Read more
15 Mar 2024
I’ve been playing around with OpenAI’s GPT-4 API and I wanted to share a quick summary and code sample. Why... Read more
28 Sep 2023
SimpleForm utilizes i18n files to manage labels, hints, and defaults. The following code customizes the simple_form builder object to examine... Read more
23 Jul 2023
Amazon 360-images require a specific naming convention for their 360-images. Every item as a global identifier called an ASIN (Amazon... Read more
29 May 2023
Authorization with the amz_sp_api rubygem. First you have to handle oauth (user visits with code, you convert into tokens). After... Read more
26 Jan 2023
The idea of a date flag is to allow the user to interact with a checkbox, but the data persisted... Read more
20 Apr 2022
I love a unique radio situation from time to time. I utilized this once and wanted to save for later.... Read more
08 Mar 2022
This is 2 step solution, download locally then upload to ActiveStorage. (I couldn’t figure out how to directly write from... Read more
03 Feb 2022
This took me far longer to figure out that it should have, because google sucks. My parents were pissed off... Read more
25 Jan 2022
Update your NETLIFY function build # inside netlify.toml / in your project root [functions] node_bundler = "esbuild" Add node-fetch@2 instead... Read more
21 Jan 2022
file = CSV.generate do |writer| array_of_hashes.each_with_index do |row, index| writer << row.keys if index == 0 writer << row.values end... Read more
11 Jan 2022
For all examples, assume the class has fancy_report and amazing_images # business.rb class Business < ApplicationRecord has_one_attached :fancy_report has_many_attached :amazing_images... Read more
09 Jan 2022
Bootstrap4 Bootstrap3 Bootstrap5: Zero gutter is g-0 Boostrap5 comes with gutter utilities Catch all dimensions & viewports g-0 .. g-5... Read more
04 Jan 2022
Jekyll uses div.highlighter-rouge as the wrapper around any codeblock sections. For each block, we create a button with an event.... Read more
03 Jan 2022
A smart way to get data from AR is utilizing pluck() to extract the raw data. For example, a range... Read more
02 Jan 2022
This post assumes you have an understanding of Jekyll and React and have deployed both of them before. The goal... Read more
21 Dec 2021
Different ways of running ruby code in the heroku console $ heroku run rails runner 'PurchaseOrderJob.new("1234565").perform' $ heroku run "rails... Read more
01 Dec 2021
Seriously though… Why doesn’t this exist already? I was really annoyed when recently when I realized how common it is... Read more
25 Oct 2020
Seriously though… What is your Time Worth? I was really annoyed when someone called me and told me my voicemailbox... Read more
25 Aug 2020
Code First! Convert your Images: <!-- from this: --> <img src="big-ol-image.png" alt="Huge Image"/> <!-- to this: --> <img data-src="big-ol-image.png" src="/loading-placeholder.png"... Read more
19 Aug 2020
Package Managers are really cool, but sometimes you need to download files for yourself. Bootstrap for example lets you customize... Read more
20 Apr 2020
Generating sitemaps for react apps is much more complex that it should be. If your app is basic with a... Read more
08 Apr 2020
Bootstrap5 Bootstrap3 Bootstrap4: Comes with .no-gutters out of the box. source: https://github.com/twbs/bootstrap/pull/21211/files <div class="container"> <div class="row no-gutters"> <div class="col-6"> <div... Read more
04 Jan 2020
the best migration script is right here: models_with_files = ActiveRecord::Base.descendants.reject(&:abstract_class?).inject({}) do |reducer, model| columns = model.column_names.map { |c| $1 if... Read more
15 Feb 2019
My Task model has commit callbacks that send notifications. But the task model ALSO gets touched by a bunch of... Read more
14 Jan 2019
Ruby Union and Intersection operators Pipe | (Union) / Ampersand & (Intersection) &: intersection OR overlap The ampersand is an... Read more
01 Jan 2019
Bootstrap5 Bootstrap4 Bootstrap3: Requires custom CSS. Stylesheet: .row.no-gutters { margin-right: 0; margin-left: 0; & > [class^="col-"], & > [class*=" col-"]... Read more
04 Jan 2018
This is inspired by http://sixarm.com/about/rails-seed-data.html which i noticed had some errors. Seed Data in YAML files We use the Rails... Read more
10 Oct 2014
My colleagues and I have decades of consulting experience solving growth problems involving Amazon. We fix Chargebacks, PO problems, Invoice Shortages, and Optimize Content for optimal Search Engine discoverability.
Please send me a note. I look forward to exploring the opportunity to help grow your Amazon Sales.