Mike Coutermarsh
  • Home
  • About
  • Twitter
  • GitHub
Sign in Subscribe

CloudFlare + Azure Functions Custom Domain Setup

How to do it In CloudFlare, setup your DNS entry to look like this: The key part is, leaving the “cloud” set to DNS only (only for setup, you can enable CDN after setup). Once you do that, click “Validate” in Azure and you’ll get that “Domain Ownership” box
Jan 20, 2019

Serverless + Cloudflare Workers + NPM Modules

Here is how I got NPM modules working with Cloudflare workers + Serverless. 1. Install webpack npm install --save-dev webpack 1. Add a webpack config. webpack.config.js module.exports = { target: 'webworker' }; 1. Add build to your package.json "build": "webpack yourFunctionFile.js", 1. Update
Oct 21, 2018

Highlight.js with Webpacker and Rails

Key is: use the hightlightjs shim. Install it using yarn. yarn add highlightjs Inside one of your packs (or application.js), add: import hljs from 'highlightjs' hljs.initHighlightingOnLoad();
Apr 14, 2018

Quick tip for sending better Slack DMs

Quickly improve the effectiveness of your communication via Slack by making your messages actionable. Bad Hey, can you do me a favor? Better Hey, can you do me a favor? This user account is locked out. Best Hey, can you do me a favor? This user account is locked out
Oct 30, 2017

AWS Policy - Full S3 Access for a Single Bucket

I’ve found myself googling this every couple months. So I’m posting an example here to save you and myself in the future. If you’re creating an API user with full access to only a SINGLE S3 bucket, this example policy will work for you. If you want
Sep 25, 2017

Storing Emails in Postgres + Rails - Use Citext

Text fields in Postgres are case sensitive. This is a problem when storing emails because coutermarsh.mike@gmail.com and Coutermarsh.Mike@Gmail.com are not equal. If you do any lookups by email address, you have a few options. 1. always use downcase on write 2. use a functional
Aug 29, 2017 2 min read

Selecting a value from JSONB - Postgres

Quick postgres tip. If you have a JSONB column named “options” and it has a key “favorite_color”. Here is an example on how you select the value from it: SELECT options->'favorite_color' FROM table_name; Filter by a jsonb value: SELECT COUNT(*) FROM table_name
Aug 7, 2017

Mistakes implementing avatars

In the past 3 years, we’ve gone through several iterations of how we host avatars on Product Hunt. There were a lot of mistakes. This is what I recommend doing if you’re adding avatars to your web app. Short version: 1. Upload the original image directly to S3.
Jul 30, 2017 1 min read

Rails: Should I have a separate model for a user profile?

Every case is different. But I’d be wary of ever creating a dedicated model for a UserProfile. It sounds like a very general “throw everything here” type of model. Which is something you should avoid. It’s better to be very specific about the type of data being stored.
Apr 28, 2017 1 min read

My Top 3 Rails Best Practices

Here are my top 3 suggestions to improve your Rails codebase. 1. Learn the presenter and service object patterns. This allows you to break down complex logic into small, self contained and easily tested classes. This makes writing/changing/reading code easy. Remember to namespace things and create clear separation
Mar 29, 2017 1 min read

How do I know if I'll be interested in Computer Science?

Mar 16, 2017

Rails + Capybara + Selenium + Chrome Driver setup

Just setup our Capybara tests to use Chrome driver. Here is how I did it. First, added group :test do gem 'capybara' gem 'selenium-webdriver' gem 'chromedriver-helper' # <- New! end Then in the spec_helper.rb Capybara.register_driver :selenium do |app| Capybara::Selenium:
Mar 3, 2017 1 min read

Rails Mailer Preview URL

The Rails mailer preview URL is impossible to remember. URL: http://localhost:3000/rails/mailers So I’m putting it here. Hopefully this just saved you time while googling. If you need more info about how to use previews. Read this.
Feb 28, 2017

Purge image from imgix with Ruby

Here’s how we purge images from imgix’s cache at Product Hunt with Ruby. If you’re googling around for a solution, hopefully this code helps you out. Imgix docs: https://docs.imgix.com/setup/purging-images # usage: Set env variable IMGIX_API_KEY to your api key # Need to
Nov 15, 2016

The IO object for media must respond to to_io

If you’re getting this error with the Twitter gem’s update_with_media method. And googling around for the solution. I’m here to help you. Twitter::Error::UnacceptableIO The IO object for media must respond to to_io Why this happens When you call open in Ruby with
Jul 19, 2016 1 min read

Where can I find people to learn to code with?

View this post on Quora.
Jul 2, 2016

What is the best way to become a great programmer?

View this post on Quora.
Jul 2, 2016

Jr. Developers #6: You feel like you have no idea what you’re doing and that’s totally OK

View this post on Medium.
Jun 25, 2016

Rails + Storing User Settings — 2016 Edition

View this post on Medium.
Jun 12, 2016

How important is it to choose a first programming language?

May 3, 2016

Jr. Developers #5: How to Improve Code Without Anyone Hating You

View this post on Medium.
Mar 9, 2016

Jr. Developers #4: Don’t Be Afraid of Meetups

View this post on Medium.
Feb 2, 2016

Jr. Developers #3: Should I Learn X or Y?

View this post on Medium.
Jan 16, 2016

Jr. Developers #2: Think Small to Ship Fast

View this post on Medium.
Jan 1, 2016

A Ruby Developers Guide to Creating Node Modules

View this post on Medium.
Dec 30, 2015
← Newer Posts Page 3 of 5 Older Posts →
Mike Coutermarsh © 2025
  • HTML/CSS to Image API
  • Twitter
  • GitHub
  • LinkedIn