Working on a WordPress Theme, but inside of another repo. Best option I thought of was using a submodule. I also need that theme to pull WordPress Customizer Color Values, but the theme is using Sass, so there has to be some type of Sass compiler on the server. So using Git’s work-tree set-up, I… Continue reading Git Submodule Work-Tree Hook on Push to Compile Sass
GIT Using SSH to Push Remote to Server
On the server terminal, type: git remote add origin ssh://[email protected]:22/home/user/remote.git The name of your remote repo will be ‘origin’. ‘user’ is your user name, ‘domian.com’ is your domain or IP address. ‘:22’ is the port number used to connect to your ssh server. ‘/home/user/remote.git’ is the location of your remote git repo. Before you push… Continue reading GIT Using SSH to Push Remote to Server
WordPress: change all url/websites address in posts
The SQL statement to change all references of a string in WordPress posts is: UPDATE wp_posts SET post_content = REPLACE(post_content, ‘staging.server.com’, ‘www.productionserver.com’);
Quickly Testing TTFB (Time To First Byte) with Apache Benchmarking Tool
Checking the cause of a high TTFB (Time To First Byte) can be time consuming. And pinpointing the issue requires multiple tests against even the smallest changes. Enter Apache’s Benchmarking Tool ab to help with quick testing. ab -n 100 http://www.website.com/ The above command will execute 100 tests against the website entered. The results are… Continue reading Quickly Testing TTFB (Time To First Byte) with Apache Benchmarking Tool
Pushing Large Git Repository
Pushing a large Git Repository can cause issues; time-outs, disconnects or general freezing tend to happen with especially large Git Repos. The best way to handle pushing those large git repos is to break the pushes down into commit chunks. Using git log you can decide how far back and how many chunks you would… Continue reading Pushing Large Git Repository
Create Git Archive From Specific Commit Range
git archive -o ~/Desktop/update.zip HEAD $(git diff –name-only f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a –diff-filter=ACMRTUXB) The above command will create a zip archive from your git repo from commit ‘f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a’ to your latest commit being the HEAD. The –diff-filter=ACMRTUXB will prevent an error if you’ve deleted files between ‘f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a’ and HEAD. The above example will produce a zip file on… Continue reading Create Git Archive From Specific Commit Range
OpenX – PHP 5.4.34 Upgrade Error Fix
If your OpenX installation is printing-out the following: Strict Standards: Non-static method PEAR::setErrorHandling() should not be called statically in /home/user/directory/lib/Max.php on line 222 Strict Standards: Non-static method OA::debug() should not be called statically, assuming $this from incompatible context in /home/user/directory/lib/max/ErrorHandler.php on line 134 Strict Standards: Non-static method Log::singleton() should not be called statically, assuming $this… Continue reading OpenX – PHP 5.4.34 Upgrade Error Fix
Why To Use LZMA Compression
There are always times when you zip, gzip and bzip2 files and directories to try and gain the highest compression ratio you can. But, have you tried LZMA compression? LZMA compression routinely obtains the highest compression ratio for any file type or directory of files. If you haven’t tried it, give it a try in… Continue reading Why To Use LZMA Compression
Prevent Ampersand Issues in Javascript on WordPress Pages & Posts
Ampersands in WordPress Posts and Pages are always encoded into either their numeric (&) or name (&) html entity. This can become troublesome if you are including javascript into the page or post. Using the ampersand’s unicode code point value (0026) is the best way around this issue. So writing ampersand would be done by… Continue reading Prevent Ampersand Issues in Javascript on WordPress Pages & Posts
Quickly Run A HTTP Server From Any Directory
Python makes it easy to run a simple http server from any directory on your system. From command line execute the following command from the directory you would like the server to run from: $ python -m SimpleHTTPServer 8080 A simple http server will be running with the root being whatever directory you executed the… Continue reading Quickly Run A HTTP Server From Any Directory