In order to prevent a website from caching your css/js/whatever you can add a variable to the call and update it when you release new code.
Here’s an example of a quick way to update all of the calls via command line in any particular directory:
find ./ -type f -exec sed -i -e 's/master.min.css?v=1.1.1/master.min.css?v=1.1.2/g' {} \;
Decided to give Hello Fresh a try. Here is the unboxing!
4 gallons apple juice ~$10
2.5 lbs honey ~$6.50
1 yeast packet ~$1
1 gallon boiling water
~5 gallons = 640 ozs
640/16 = 40 pints
17.50/40 = ~$0.44/pint
Dates:
3/14 – Primary fermenter
4/1 – Secondary fermenter
5/15 – Kegged and added 1 quart of apple juice and 1/2 lb honey
When moving from a stage site to production, sometimes it’s necessary to update the GUIDs. Doing a quick REPLACE() is an easy way to accomplish this.
UPDATE wp_posts
SET guid = REPLACE(guid, 'http://stage.somesite.com', 'http://www.somesite.com')
WHERE guid LIKE '%http://stage.somesite.com%'
To recursively update the permissions on directories in the uploads directory in WordPress from the wp-contents directory run:
find uploads/ -type d -exec chmod 775 {} +
I find myself copying production databases over stage databases often. In WordPress the uploads directory needs to be copied as well, but I don’t want to copy old stuff over.
From production /wp-content/
cp -Rup uploads/* /websites/stage.somesite.com/public_html/wp-content/uploads/
ln -s public_html_master public_tmp && mv -Tf public_tmp public_html
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE a.post_type = 'listing'
Below is code I put into my .htaccess to set an environment variable to change the content/theme for mobile users.
# Mobile
SetEnvIf User-Agent "Mobile" IS_MOBILE
SetEnvIf User-Agent "Googlebot-Mobile" IS_MOBILE
SetEnvIf User-Agent "BlackBerry" IS_MOBILE
SetEnvIf User-Agent "iPod" IS_MOBILE
SetEnvIf User-Agent "iPhone" IS_MOBILE
SetEnvIf User-Agent "NetFront" IS_MOBILE
SetEnvIf User-Agent "Symbian OS" IS_MOBILE
SetEnvIf User-Agent "Windows Phone" IS_MOBILE
Notice that ‘Android’ is not present in the User-Agent check. While testing with a Galaxy Nexus and Nexus 7, I noticed that the easiest way to tell the difference between Android on phones vs. Android on tablets was to check for ‘Mobile’.
From here I can access IS_MOBILE via PHP like so:
if (isset($_SERVER['IS_MOBILE'])) {
include('index-mobile.php');exit;
}
'Word document' and 'website' don't really go together…