@salcode@phpc.social
@salcode@phpc.social avatar

salcode

@salcode@phpc.social

Web Developer specializing in WordPress, loves Git, works at WebDevStudios. Good at metaphors. He / him.

#git #vim #neovim #WordPress

This profile is from a federated server and may be incomplete. Browse more on the original instance.

salcode, to wordpress
@salcode@phpc.social avatar

Great article on writing code to enhance a core block in the block editor.

https://micheal.dev/blog/enhancing-existing-gutenberg-blocks-a-step-by-step-guide-with-react-and-wordpress/

salcode, to random
@salcode@phpc.social avatar

My notes on how I check if my branch is up to date with another branch (and the alias I use to make it easier).

https://salferrarello.com/is-git-branch-up-to-date/

salcode, to random
@salcode@phpc.social avatar

I got to spend a bunch of time this week introducing a group of young people to yo-yoing 🪀 🎉.

It inspired me to clean and restring my batch of yo-yos today 😀

salcode, to random
@salcode@phpc.social avatar

I wrote a script that included retrieving the title of a Jira issue from their REST API.

These are my notes on how I retrieved the title. https://salferrarello.com/get-jira-issue-title-via-rest-api/

salcode, to RSS
@salcode@phpc.social avatar

Is there an feed for "Cybersecurity Advisories for Cybersecurity and Infrastructure Security Agency" https://www.cisa.gov/ ?

My attempts to add this to my feed reader have failed 🙁

salcode,
@salcode@phpc.social avatar

@skyportradio Thanks! This is a great site to know about!

I'm using @feedbin so another option for me is using their "Subscribe to Email" feature https://feedbin.com/blog/2016/02/03/subscribe-to-email-newsletters-in-feedbin/

However, cisa.gov seems like a site that should have RSS feeds for this information. I wanted to make sure I wasn't overlooking an official feed before using one of these other methods. Unfortunately, it looks like they just don't have RSS setup. 🙁

salcode, to random
@salcode@phpc.social avatar

One thing that has always frustrated me about the app, is when a workflow pastes text into the current app, it overwrite the clipboard 🙁

But it turns out, you can use Apple Script in your workflow to type keystrokes (instead of using the clipboard) 🎉

I've written up some notes on this at https://salferrarello.com/alfred-paste-without-clipboard/

b0rk, to random
@b0rk@jvns.ca avatar

what are your favourite git config options to set? Right now I only really have git config push.autosetupremote true and git config init.defaultBranch main set in my ~/.gitconfig, curious about what other people set

(diff algorithm patience? a custom diff/merge tool? enable rerere?)

salcode,
@salcode@phpc.social avatar

@b0rk One option I haven't seen mentioned yet that I'm a big fan of is

checkout.defaultRemote=origin

This prevents the error "matched multiple remote tracking branches"

https://salferrarello.com/git-matched-multiple-remote-tracking-branches/

salcode, to random
@salcode@phpc.social avatar

I watched "Now You See Me" with my boys over the weekend. I'd forgotten how much fun this movie is (and it reminded me how much I like magic 😀).

https://www.imdb.com/title/tt1670345/

salcode, to wordpress
@salcode@phpc.social avatar

When doing development I often find it helpful to run some test code with .

Historically, this involves me relearning how to create a WP CLI command, so I've make these notes to speed me up in the future.

https://salferrarello.com/quick-and-dirty-wp-cli/

salzano, to random
@salzano@mastodon.social avatar

phpcs . --standard=WordPress
phpcs . --standard=WordPress -s

salcode,
@salcode@phpc.social avatar

@salzano

Ha ha, I'm glad the blog post was helpful. 😀

(I never remember this either)

salcode,
@salcode@phpc.social avatar

@salzano ah, I get it. Then you’re a step ahead of me. I have to visit the page to remind myself the flag I need is -s 😆

dpom, to random
@dpom@fosstodon.org avatar

I keep having to look this up, so in case you are in the same boat, the syntax for ignoring a file or pattern in #git diff is:

git diff -- ':(exclude)*min.js’ ‘:(exclude)pnpm-lock.yaml'

(double quotes on Windows)

salcode,
@salcode@phpc.social avatar

@dpom Good stuff.

I was surprised to learn about "(exclude)" as I've used ! in the past.

e.g.
git diff main ':!.package-lock.json'

It looks like ! is the short version of (exclude) for the "magic signature" feature of pathspec

https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec

about "magic signature"

Thanks!

salcode,
@salcode@phpc.social avatar

@dpom Ha ha, that is wild!

salzano, to random
@salzano@mastodon.social avatar
salcode,
@salcode@phpc.social avatar

@salzano

Wired had a great article on the 6-feet social distancing error back in May 2021 https://www.wired.com/story/the-teeny-tiny-scientific-screwup-that-helped-covid-kill/

salcode,
@salcode@phpc.social avatar

@salzano According to my records, I sent this to some family members in June 2021, so it wasn't paywalled then. 🤷

salcode, to markdown
@salcode@phpc.social avatar

I had to convert some markdown into plaintext and I wanted to do it locally rather than use an online tool. I ended up using and made these notes about it.

https://salferrarello.com/convert-markdown-to-plaintext/

jef, to random
@jef@mastodon.social avatar

Happy MAGAt Tasing Himself In The Nuts Until He Died Day to those who celebrate

salcode,
@salcode@phpc.social avatar
salcode, to random
@salcode@phpc.social avatar

My son: I promise Dad, I’ll finish emptying the dishwasher right after school.

Me: No problem, I’ll leave you a reminder.

salcode,
@salcode@phpc.social avatar

@django Ha ha, in his defense he'd probably do it anyway but I wanted to be certain 😀.

Happy New Year to you too!

salcode, to webdev
@salcode@phpc.social avatar

Pro-tip: The more fields you require, the more bad data you're going to get.

Brought to you by Reverend Sal 😀

salcode, to random
@salcode@phpc.social avatar

Guess who won the WebDevStudios “Ugly Sweater Contest” this year!

salcode, to random
@salcode@phpc.social avatar

When creating small examples, I find it nice to have very short commit hashes.

As with so many things in Git, we can pass an argument to set this 😀 (--abbrev=4).

git log --oneline

330c29e Add c.txt
c14546b Add b.txt
f6c7ba1 Add a.txt


git log --oneline --abbrev=4

330c Add c.txt
c145 Add b.txt
f6c7 Add a.txt

https://salferrarello.com/set-number-of-characters-in-commit-hash-for-git-log/

josh412, to wordpress
@josh412@fosstodon.org avatar

I wrote a blog post a while ago about unit testing PHP classes that rely on functions from WordPress core.

https://dev.to/shelob9/unit-testing-classes-that-call-functions-form-wordpress-core-3h5p

salcode,
@salcode@phpc.social avatar

@josh412

Thanks for sharing this. I enjoyed the article and Brain Monkey is a cool project for testing.

My favorite part of the article is

> I often get asked how to test a class that calls add_action() and add_filter() in the constructor and then has callback functions in the same class. The best advice I can give you is don't do that.

I'd like to get this framed 😀

salcode, to random
@salcode@phpc.social avatar

As a web developer, I often find myself using hard refresh (Cmd + Shift + r on my Mac). This works for Chrome, other Chromium based browsers, and Firefox, however Safari uses a different key combination 🤦‍♂️

Fortunately, my co-worker Amor has a great solution for this - to set an App Shortcut for Safari that uses the same key combination. 🎉

His instructions are at https://itsamoreh.dev/remap-shortcut-for-safari-force-refresh/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines