Category: Code
-
Understanding and Fixing the sprintf PHP Error: Unknown Format Specifier “w”
If you’ve ever encountered the error “unknown format specifier ‘w’” in PHP while using the sprintf function, you’re not alone. This common issue arises when sprintf encounters an unrecognized format specifier. Let’s dive into what causes this error and how to fix it. What is sprintf? The sprintf function in PHP is used to format…
-
How to fix Call to undefined method WP_Translations::translate_entry()
If your WordPress site uses the plugin RokSprocket, you just upgraded to WordPress 6.5, and are getting this error… fix for Call to undefined method WP_Translations::translate_entry() go to /wp_content/plugins/wp_rokcommon/RokCommon/l18N/Wordpress.php at line 38, 72, 98 change
-
Setting up Push-to-Deploy with git – Kris Jordan
I first set up a push-to-deploy system with git and puppet for a side project a few years back. It worked so well I transitioned my company’s development process onto it for all of our new projects starting last year. It offers the simplicity of the “push-to-deploy” model Heroku pioneered, with full control and flexibility…
-
Setup .dev root domain for local web development on mac
Terminal commands for setting up a .dev root domain on your Mac OS X 10.9+ for local development. Homebrew ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” dnsmasq brew install dnsmasq cd $(brew –prefix) mkdir etc echo ‘address=/.dev/127.0.0.1’ > etc/dnsmasq.conf sudo cp -v $(brew –prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist sudo mkdir /etc/resolver sudo bash -c…
-
IE8 checkbox not printing bug fix using jQuery
checkbox IE8 bug IE8 has a bug where if you check a checkbox then print the form the checkbox does not show as being checked. MSFT bug #431489 I’ve found that this piece of code solves that problem and it works for HTML5. IE8 checkbox printing bug FIX // fix for ie8 printed checkbox bug…
-
How to create a 1 gig file
dd if=/dev/zero of=big-file.bin bs=1g count=1 or mkfile 1g big-file.bin
-
How to tar a directory and only include certain file types
find myProjectDirectory -type f \( -name \*\.php -o -name \*\.js -o -name \*\.css -o -name \*\.inc \) | xargs tar -rf myProjectTarName.tar