• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for Dev Tips

Dev Tips

Setting Up a New Mac

Last updated on November 9, 2021 by Sal Ferrarello

I recently setup a new MacBook as my primary machine and I made these notes in the hope they will streamline the process for me in the future.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft Tagged With: mac, tools

Alfred Jira Workflow

Last updated on September 29, 2020 by Sal Ferrarello

As part of my work I spend a lot of time in Jira. Now that I’m using Alfred as part of my daily routine, I’ve created an Alfred workflow to help me.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft Tagged With: Alfred, Jira

Git warning: Pulling without specifying how to reconcile divergent branches is discouraged

Last updated on October 31, 2022 by Sal Ferrarello

When using Git version 2.27.0 or higher running the command ‘git pull’ will display, “warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull”.

Filed Under: Computing, Dev Tips, Recommendations, Solution Tagged With: Git, gitconfig

Git Work Email

Last updated on August 14, 2020 by Sal Ferrarello

I use Git in both my personal and professional life. Depending on the context, I want to use different contact information. This is how I set this up on my machine.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: Git, gitconfig

Git Change Default Branch to Main

Last updated on August 14, 2020 by Sal Ferrarello

In Git 2.28 you can change the default branch name from ‘master’ to whatever you want (the name ‘main’ seems to be a popular choice). This is the command to run to add this to your configuration.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: Git, gitconfig

Enable, Read, and Write Post Meta in WordPress Gutenberg

Last updated on January 13, 2021 by Sal Ferrarello

The WordPress block editor (a.k.a. Gutenberg) communicates with the database via the WordPress REST API. We can read and write post meta from within the Gutenberg editor after we enable the specific post meta field in the WordPress REST API.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming Tagged With: Gutenberg, WordPress, WordPress Post Meta

Join Strings with Commas and “And” in JavaScript

Last updated on July 16, 2020 by Sal Ferrarello

In English the rules we use for joining a list of items involves more work than a standard join in JavaScript. Here is JavaScript code to join an array of elements with commas and an “and”.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming, Solution Tagged With: JavaScript

Git alias to open Jira URL

Last updated on January 29, 2021 by Sal Ferrarello

As a developer, I spend a lot of time going back and forth between the command line and Jira tickets. I realized that since I always include the Jira ticket identifier (e.g. `sf-123`) in the branch name (in a reliable position), I could write a git alias to open the corresponding URL. This is how I implemented this behavior.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git, git alias, gitconfig, Jira, regular expressions

Why __() needs a hardcoded string in WordPress

Last updated on June 18, 2020 by Sal Ferrarello

When using a WordPress translation function, e.g. __(), you need to use a hardcoded string (not a variable).

Filed Under: Dev Tips, Programming, Recommendations Tagged With: Internationalization (I18n), WordPress

JavaScript get Date in YYYYMMDD Format

Last updated on June 15, 2020 by Sal Ferrarello

Recently, I was working in JavaScript and I need to transform a date into the format YYYYMMDD, this is how I did it.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Programming, Solution Tagged With: DateTime, JavaScript

  • «Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 4
  • Go to page 5
  • Go to page 6
  • Go to page 7
  • Go to page 8
  • Interim pages omitted …
  • Go to page 20
  • Next Page»

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in