• 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

Prevent Dragging an HTML Element

Last updated on March 21, 2023 by Sal Ferrarello

Sometimes users accidentally drag an HTML element into an editable area. This can be prevented by adding draggable=”false” to the element.

Filed Under: Dev Tips, Programming, Solution Tagged With: HTML

Git Get Current Branch Name

Last updated on March 18, 2023 by Sal Ferrarello

I find there are two different times I want to get the current branch name: 1. When I’m at the command line, 2. Inside a Git alias function I’m writing. Interestingly, I find that my approach in these two situations are different.

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

phpcs no matches found ignore

Last updated on March 13, 2023 by Sal Ferrarello

When running phpcs with the –ignore option (because I don’t want to scan the /vendor nor /node_modules directories), I kept getting the error “zsh: no matches found: –ignore=/vendor/*,/node_modules/*”.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: PHPCS, zsh

Git Branch Naming

Last updated on February 26, 2023 by Sal Ferrarello

There are lots of ways to name Git branches. These are my personal rules I’ve developed for naming Git branches.

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

Don’t Do It Now, Open an Issue Instead

Last updated on February 26, 2023 by Sal Ferrarello

When working on an issue, it is easy to get sidetracked by other unrelated changes that need to be made. I’ve found that instead of addressing other issues as I spot them, taking a moment to open an issue and then ignoring them allows me to stay focused on the task at hand.

Filed Under: Dev Tips, Programming, Recommendations, Solution Tagged With: focus, lifehack, motivation

Replace Local Git Branch with Remote Version

Last updated on February 20, 2023 by Sal Ferrarello

This situation often arises for me when I’m reviewing a teammate’s Pull Request and they make changes by rewriting history. In this situation, I want to discard my local copy of the Pull Request branch and replace it with the version on GitHub (or wherever the remote branch is being stored).

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

WordPress View Block Attributes

Last updated on February 8, 2023 by Sal Ferrarello

When developing a WordPress plugin that creates a Gutenberg block, it is invaluable to be able to view the attributes on the block. Here are some tricks I use to view this information.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: block, Gutenberg, WordPress, WordPress Plugin

Automatically Switch Node Version in Zsh from package.json

Last updated on January 12, 2023 by Sal Ferrarello

Add this code to $HOME/.zshrc to automatically set the node version to match the version in package.json.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: command line, jq, node, nvm, zsh

Getting Started with LuaSnip

Last updated on November 23, 2022 by Sal Ferrarello

This article assumes you are using Neovim (version 0.8.0 or higher) and packer.nvim to manage your plugins. Adding the following loads the LuaSnip plugin, creates a snippet for “func”, and maps “Ctrl + p” to expand the snippet and jump through the fields.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: lua, neovim, vim, vimplugin

Git autoSetupRemote Prevents “no tracking information” Error

Last updated on November 14, 2022 by Sal Ferrarello

After creating a pushing a new branch to GitHub (or any remote), when I do “git pull” I often get an error that says “There is no tracking information for the current branch”. The Git config value “autoSetupRemote”, introduced in Git version 2.38, lets us avoid this entirely error.

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

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 20
  • Next Page»

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